From 2654ddd2d595c2f8528aafa3af30db90beb0a5b7 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Tue, 19 May 2020 00:05:56 +0200 Subject: [PATCH 01/35] - Fix MDEV-22571 and MDEV-22572. Allow multiple ZIP table and enable using special column in them. modified: storage/connect/tabzip.cpp modified: storage/connect/tabzip.h - Fix some compiler errors modified: storage/connect/tabcmg.cpp --- storage/connect/tabcmg.cpp | 2 ++ storage/connect/tabzip.cpp | 13 +++++++++++-- storage/connect/tabzip.h | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/storage/connect/tabcmg.cpp b/storage/connect/tabcmg.cpp index b9b7f6e4b60..f2ff721627c 100644 --- a/storage/connect/tabcmg.cpp +++ b/storage/connect/tabcmg.cpp @@ -26,6 +26,8 @@ #include "tabmul.h" #include "filter.h" +PQRYRES MGOColumns(PGLOBAL g, PCSZ db, PCSZ uri, PTOS topt, bool info); + /* -------------------------- Class CMGDISC -------------------------- */ /***********************************************************************/ diff --git a/storage/connect/tabzip.cpp b/storage/connect/tabzip.cpp index c026744dba8..d9c13e2a58a 100644 --- a/storage/connect/tabzip.cpp +++ b/storage/connect/tabzip.cpp @@ -23,6 +23,7 @@ #include "filamzip.h" #include "resource.h" // for IDS_COLUMNS #include "tabdos.h" +#include "tabmul.h" #include "tabzip.h" /* -------------------------- Class ZIPDEF --------------------------- */ @@ -41,7 +42,14 @@ bool ZIPDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) /***********************************************************************/ PTDB ZIPDEF::GetTable(PGLOBAL g, MODE m) { - return new(g) TDBZIP(this); + PTDB tdbp = NULL; + + tdbp = new(g) TDBZIP(this); + + if (Multiple) + tdbp = new(g) TDBMUL(tdbp); + + return tdbp; } // end of GetTable /* ------------------------------------------------------------------- */ @@ -108,7 +116,7 @@ int TDBZIP::Cardinality(PGLOBAL g) Cardinal = (err == UNZ_OK) ? (int)ginfo.number_entry : 0; } else - Cardinal = 0; + Cardinal = 10; // Dummy for multiple tables } // endif Cardinal @@ -187,6 +195,7 @@ int TDBZIP::DeleteDB(PGLOBAL g, int irc) void TDBZIP::CloseDB(PGLOBAL g) { close(); + nexterr = UNZ_OK; // For multiple tables Use = USE_READY; // Just to be clean } // end of CloseDB diff --git a/storage/connect/tabzip.h b/storage/connect/tabzip.h index 32b15281f81..d36e4dc01d0 100644 --- a/storage/connect/tabzip.h +++ b/storage/connect/tabzip.h @@ -48,6 +48,8 @@ public: // Implementation virtual AMT GetAmType(void) {return TYPE_AM_ZIP;} + virtual PCSZ GetFile(PGLOBAL) {return zfn;} + virtual void SetFile(PGLOBAL, PCSZ fn) {zfn = fn;} // Methods virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); From 1e07df99f30842f5479eaf068ce4131023615721 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Mon, 13 Jul 2020 16:30:57 +0200 Subject: [PATCH 02/35] - Fix MDEV-22561 Unable to access DBF inside a ZIP archive modified: storage/connect/filamdbf.cpp modified: storage/connect/filamdbf.h modified: storage/connect/filamzip.cpp modified: storage/connect/filamzip.h modified: storage/connect/ha_connect.cc modified: storage/connect/plgxml.cpp modified: storage/connect/tabdos.cpp modified: storage/connect/tabdos.h modified: storage/connect/tabfix.h - Add/Init Level class member modified: storage/connect/mongo.cpp modified: storage/connect/mongo.h modified: storage/connect/tabjson.cpp modified: storage/connect/tabjson.h - Typo modified: storage/connect/connect.cc --- storage/connect/connect.cc | 1 - storage/connect/filamdbf.cpp | 195 +++++++++++++++++------ storage/connect/filamdbf.h | 2 +- storage/connect/filamzip.cpp | 282 ++++++++++++++++++++++++++++++++-- storage/connect/filamzip.h | 38 ++++- storage/connect/ha_connect.cc | 7 +- storage/connect/mongo.cpp | 1 - storage/connect/mongo.h | 1 - storage/connect/plgxml.cpp | 2 +- storage/connect/tabdos.cpp | 36 +++-- storage/connect/tabdos.h | 1 + storage/connect/tabfix.h | 18 ++- storage/connect/tabjson.cpp | 1 + storage/connect/tabjson.h | 1 - 14 files changed, 488 insertions(+), 98 deletions(-) diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index dfc619cf4af..2a0f2ed037f 100644 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -355,7 +355,6 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2, } // endif mode rcop = false; - } catch (int n) { if (trace(1)) htrc("Exception %d: %s\n", n, g->Message); diff --git a/storage/connect/filamdbf.cpp b/storage/connect/filamdbf.cpp index c8bab2b53a4..8278ff4ceec 100644 --- a/storage/connect/filamdbf.cpp +++ b/storage/connect/filamdbf.cpp @@ -49,6 +49,7 @@ #include "global.h" #include "plgdbsem.h" #include "filamdbf.h" +#include "filamzip.h" #include "tabdos.h" #include "valblk.h" #define NO_FUNC @@ -139,7 +140,7 @@ static int dbfhead(PGLOBAL g, FILE *file, PCSZ fn, DBFHEADER *buf) if (fread(buf, HEADLEN, 1, file) != 1) { strcpy(g->Message, MSG(NO_READ_32)); return RC_NF; - } // endif fread + } // endif fread // Check first byte to be sure of .dbf type if ((buf->Version & 0x03) != DBFTYPE) { @@ -149,7 +150,7 @@ static int dbfhead(PGLOBAL g, FILE *file, PCSZ fn, DBFHEADER *buf) if ((buf->Version & 0x30) == 0x30) { strcpy(g->Message, MSG(FOXPRO_FILE)); dbc = 264; // FoxPro database container - } // endif Version + } // endif Version } else strcpy(g->Message, MSG(DBASE_FILE)); @@ -158,12 +159,12 @@ static int dbfhead(PGLOBAL g, FILE *file, PCSZ fn, DBFHEADER *buf) if (fseek(file, buf->Headlen() - dbc, SEEK_SET) != 0) { sprintf(g->Message, MSG(BAD_HEADER), fn); return RC_FX; - } // endif fseek + } // endif fseek if (fread(&endmark, 2, 1, file) != 1) { strcpy(g->Message, MSG(BAD_HEAD_END)); return RC_FX; - } // endif fread + } // endif fread // Some files have just 1D others have 1D00 following fields if (endmark[0] != EOH && endmark[1] != EOH) { @@ -172,7 +173,7 @@ static int dbfhead(PGLOBAL g, FILE *file, PCSZ fn, DBFHEADER *buf) if (rc == RC_OK) return RC_FX; - } // endif endmark + } // endif endmark // Calculate here the number of fields while we have the dbc info buf->SetFields((buf->Headlen() - dbc - 1) / 32); @@ -180,13 +181,58 @@ static int dbfhead(PGLOBAL g, FILE *file, PCSZ fn, DBFHEADER *buf) return rc; } // end of dbfhead +/****************************************************************************/ +/* dbfields: Analyze a DBF header and set the table fields number. */ +/* Parameters: */ +/* PGLOBAL g -- pointer to the CONNECT Global structure */ +/* DBFHEADER *hdrp -- pointer to _dbfheader structure */ +/* Returns: */ +/* RC_OK, RC_INFO, or RC_FX if error. */ +/****************************************************************************/ +int dbfields(PGLOBAL g, DBFHEADER* hdrp) +{ + char* endmark; + int dbc = 2, rc = RC_OK; + + *g->Message = '\0'; + + // Check first byte to be sure of .dbf type + if ((hdrp->Version & 0x03) != DBFTYPE) { + strcpy(g->Message, MSG(NOT_A_DBF_FILE)); + rc = RC_INFO; + + if ((hdrp->Version & 0x30) == 0x30) { + strcpy(g->Message, MSG(FOXPRO_FILE)); + dbc = 264; // FoxPro database container + } // endif Version + + } else + strcpy(g->Message, MSG(DBASE_FILE)); + + // Check last byte(s) of header + endmark = (char*)hdrp + hdrp->Headlen() - dbc; + + // Some headers just have 1D others have 1D00 following fields + if (endmark[0] != EOH && endmark[1] != EOH) { + sprintf(g->Message, MSG(NO_0DH_HEAD), dbc); + + if (rc == RC_OK) + return RC_FX; + + } // endif endmark + + // Calculate here the number of fields while we have the dbc info + hdrp->SetFields((hdrp->Headlen() - dbc - 1) / 32); + return rc; +} // end of dbfields + /* -------------------------- Function DBFColumns ------------------------- */ /****************************************************************************/ /* DBFColumns: constructs the result blocks containing the description */ /* of all the columns of a DBF file that will be retrieved by #GetData. */ /****************************************************************************/ -PQRYRES DBFColumns(PGLOBAL g, PCSZ dp, PCSZ fn, bool info) +PQRYRES DBFColumns(PGLOBAL g, PCSZ dp, PCSZ fn, PTOS topt, bool info) { int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING, TYPE_INT, TYPE_INT, TYPE_SHORT}; @@ -196,10 +242,12 @@ PQRYRES DBFColumns(PGLOBAL g, PCSZ dp, PCSZ fn, bool info) char buf[2], filename[_MAX_PATH]; int ncol = sizeof(buftyp) / sizeof(int); int rc, type, len, field, fields; - bool bad; - DBFHEADER mainhead; - DESCRIPTOR thisfield; - FILE *infile = NULL; + bool bad, mul; + PCSZ target, pwd; + DBFHEADER mainhead, *hp; + DESCRIPTOR thisfield, *tfp; + FILE *infile = NULL; + UNZIPUTL *zutp = NULL; PQRYRES qrp; PCOLRES crp; @@ -217,21 +265,55 @@ PQRYRES DBFColumns(PGLOBAL g, PCSZ dp, PCSZ fn, bool info) /************************************************************************/ PlugSetPath(filename, fn, dp); - if (!(infile= global_fopen(g, MSGID_CANNOT_OPEN, filename, "rb"))) - return NULL; + if (topt->zipped) { + target = GetStringTableOption(g, topt, "Entry", NULL); + mul = (target && *target) ? strchr(target, '*') || strchr(target, '?') + : false; + mul = GetBooleanTableOption(g, topt, "Mulentries", mul); - /************************************************************************/ - /* Get the first 32 bytes of the header. */ - /************************************************************************/ - if ((rc = dbfhead(g, infile, filename, &mainhead)) == RC_FX) { - fclose(infile); - return NULL; - } // endif dbfhead + if (mul) { + strcpy(g->Message, "Cannot find column definition for multiple entries"); + return NULL; + } // endif Multiple - /************************************************************************/ - /* Allocate the structures used to refer to the result set. */ - /************************************************************************/ - fields = mainhead.Fields(); + pwd = GetStringTableOption(g, topt, "Password", NULL); + zutp = new(g) UNZIPUTL(target, pwd, mul); + + if (!zutp->OpenTable(g, MODE_READ, filename)) + hp = (DBFHEADER*)zutp->memory; + else + return NULL; + + /**********************************************************************/ + /* Set the table fields number. */ + /**********************************************************************/ + if ((rc = dbfields(g, hp)) == RC_FX) { + zutp->close(); + return NULL; + } // endif dbfields + + tfp = (DESCRIPTOR*)hp; + } else { + if (!(infile = global_fopen(g, MSGID_CANNOT_OPEN, filename, "rb"))) + return NULL; + else + hp = &mainhead; + + /**********************************************************************/ + /* Get the first 32 bytes of the header. */ + /**********************************************************************/ + if ((rc = dbfhead(g, infile, filename, hp)) == RC_FX) { + fclose(infile); + return NULL; + } // endif dbfhead + + tfp = &thisfield; + } // endif zipped + + /************************************************************************/ + /* Get the number of the table fields. */ + /************************************************************************/ + fields = hp->Fields(); } else fields = 0; @@ -241,19 +323,21 @@ PQRYRES DBFColumns(PGLOBAL g, PCSZ dp, PCSZ fn, bool info) if (info || !qrp) { if (infile) fclose(infile); + else if (zutp) + zutp->close(); return qrp; - } // endif info + } // endif info if (trace(1)) { htrc("Structure of %s\n", filename); htrc("headlen=%hd reclen=%hd degree=%d\n", - mainhead.Headlen(), mainhead.Reclen(), fields); - htrc("flags(iem)=%d,%d,%d cp=%d\n", mainhead.Incompleteflag, - mainhead.Encryptflag, mainhead.Mdxflag, mainhead.Language); + hp->Headlen(), hp->Reclen(), fields); + htrc("flags(iem)=%d,%d,%d cp=%d\n", hp->Incompleteflag, + hp->Encryptflag, hp->Mdxflag, hp->Language); htrc("%hd records, last changed %02d/%02d/%d\n", - mainhead.Records(), mainhead.Filedate[1], mainhead.Filedate[2], - mainhead.Filedate[0] + (mainhead.Filedate[0] <= 30) ? 2000 : 1900); + hp->Records(), hp->Filedate[1], hp->Filedate[2], + hp->Filedate[0] + (hp->Filedate[0] <= 30) ? 2000 : 1900); htrc("Field Type Offset Len Dec Set Mdx\n"); } // endif trace @@ -265,21 +349,24 @@ PQRYRES DBFColumns(PGLOBAL g, PCSZ dp, PCSZ fn, bool info) for (field = 0; field < fields; field++) { bad = FALSE; - if (fread(&thisfield, HEADLEN, 1, infile) != 1) { + if (topt->zipped) { + tfp = (DESCRIPTOR*)((char*)tfp + HEADLEN); + } else if (fread(tfp, HEADLEN, 1, infile) != 1) { sprintf(g->Message, MSG(ERR_READING_REC), field+1, fn); goto err; - } else - len = thisfield.Length; + } // endif fread + + len = tfp->Length; if (trace(1)) htrc("%-11s %c %6ld %3d %2d %3d %3d\n", - thisfield.Name, thisfield.Type, thisfield.Offset, len, - thisfield.Decimals, thisfield.Setfield, thisfield.Mdxfield); + tfp->Name, tfp->Type, tfp->Offset, len, + tfp->Decimals, tfp->Setfield, tfp->Mdxfield); /************************************************************************/ /* Now get the results into blocks. */ /************************************************************************/ - switch (thisfield.Type) { + switch (tfp->Type) { case 'C': // Characters case 'L': // Logical 'T' or 'F' or space type = TYPE_STRING; @@ -294,7 +381,7 @@ PQRYRES DBFColumns(PGLOBAL g, PCSZ dp, PCSZ fn, bool info) // type = TYPE_INT; // break; case 'N': - type = (thisfield.Decimals) ? TYPE_DOUBLE + type = (tfp->Decimals) ? TYPE_DOUBLE : (len > 10) ? TYPE_BIGINT : TYPE_INT; break; case 'F': // Float @@ -306,8 +393,8 @@ PQRYRES DBFColumns(PGLOBAL g, PCSZ dp, PCSZ fn, bool info) break; default: if (!info) { - sprintf(g->Message, MSG(BAD_DBF_TYPE), thisfield.Type - , thisfield.Name); + sprintf(g->Message, MSG(BAD_DBF_TYPE), tfp->Type + , tfp->Name); goto err; } // endif info @@ -316,27 +403,31 @@ PQRYRES DBFColumns(PGLOBAL g, PCSZ dp, PCSZ fn, bool info) } // endswitch Type crp = qrp->Colresp; // Column Name - crp->Kdata->SetValue(thisfield.Name, field); + crp->Kdata->SetValue(tfp->Name, field); crp = crp->Next; // Data Type crp->Kdata->SetValue((int)type, field); crp = crp->Next; // Type Name if (bad) { - buf[0] = thisfield.Type; + buf[0] = tfp->Type; crp->Kdata->SetValue(buf, field); } else crp->Kdata->SetValue(GetTypeName(type), field); crp = crp->Next; // Precision - crp->Kdata->SetValue((int)thisfield.Length, field); + crp->Kdata->SetValue((int)tfp->Length, field); crp = crp->Next; // Length - crp->Kdata->SetValue((int)thisfield.Length, field); + crp->Kdata->SetValue((int)tfp->Length, field); crp = crp->Next; // Scale (precision) - crp->Kdata->SetValue((int)thisfield.Decimals, field); + crp->Kdata->SetValue((int)tfp->Decimals, field); } // endfor field qrp->Nblin = field; - fclose(infile); + + if (infile) + fclose(infile); + else if (zutp) + zutp->close(); #if 0 if (info) { @@ -347,9 +438,9 @@ PQRYRES DBFColumns(PGLOBAL g, PCSZ dp, PCSZ fn, bool info) sprintf(buf, "Ver=%02x ncol=%hu nlin=%u lrecl=%hu headlen=%hu date=%02d/%02d/%02d", - mainhead.Version, fields, mainhead.Records, mainhead.Reclen, - mainhead.Headlen, mainhead.Filedate[0], mainhead.Filedate[1], - mainhead.Filedate[2]); + hp->Version, fields, hp->Records, hp->Reclen, + hp->Headlen, hp->Filedate[0], hp->Filedate[1], + hp->Filedate[2]); strcat(g->Message, buf); } // endif info @@ -360,9 +451,13 @@ PQRYRES DBFColumns(PGLOBAL g, PCSZ dp, PCSZ fn, bool info) /**************************************************************************/ return qrp; - err: - fclose(infile); - return NULL; +err: + if (infile) + fclose(infile); + else if (zutp) + zutp->close(); + + return NULL; } // end of DBFColumns /* ---------------------------- Class DBFBASE ----------------------------- */ diff --git a/storage/connect/filamdbf.h b/storage/connect/filamdbf.h index 640fc349b4c..dfe5cb5cfc4 100644 --- a/storage/connect/filamdbf.h +++ b/storage/connect/filamdbf.h @@ -19,7 +19,7 @@ typedef class DBMFAM *PDBMFAM; /****************************************************************************/ /* Functions used externally. */ /****************************************************************************/ -PQRYRES DBFColumns(PGLOBAL g, PCSZ dp, PCSZ fn, bool info); +PQRYRES DBFColumns(PGLOBAL g, PCSZ dp, PCSZ fn, PTOS tiop, bool info); /****************************************************************************/ /* This is the base class for dBASE file access methods. */ diff --git a/storage/connect/filamzip.cpp b/storage/connect/filamzip.cpp index e76dc496246..eeb23e1f053 100644 --- a/storage/connect/filamzip.cpp +++ b/storage/connect/filamzip.cpp @@ -1,11 +1,11 @@ /*********** File AM Zip C++ Program Source Code File (.CPP) ***********/ /* PROGRAM NAME: FILAMZIP */ /* ------------- */ -/* Version 1.3 */ +/* Version 1.4 */ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 2016-2017 */ +/* (C) Copyright to the author Olivier BERTRAND 2016-2020 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -45,6 +45,62 @@ #define WRITEBUFFERSIZE (16384) +/****************************************************************************/ +/* Definitions used for DBF tables. */ +/****************************************************************************/ +#define HEADLEN 32 /* sizeof ( mainhead or thisfield ) */ +//efine MEMOLEN 10 /* length of memo field in .dbf */ +#define DBFTYPE 3 /* value of bits 0 and 1 if .dbf */ +#define EOH 0x0D /* end-of-header marker in .dbf file */ + +/****************************************************************************/ +/* First 32 bytes of a DBF table. */ +/* Note: some reserved fields are used here to store info (Fields) */ +/****************************************************************************/ +typedef struct _dbfheader { + uchar Version; /* Version information flags */ + char Filedate[3]; /* date, YYMMDD, binary. YY=year-1900 */ +private: + /* The following four members are stored in little-endian format on disk */ + char m_RecordsBuf[4]; /* records in the file */ + char m_HeadlenBuf[2]; /* bytes in the header */ + char m_ReclenBuf[2]; /* bytes in a record */ + char m_FieldsBuf[2]; /* Reserved but used to store fields */ +public: + char Incompleteflag; /* 01 if incomplete, else 00 */ + char Encryptflag; /* 01 if encrypted, else 00 */ + char Reserved2[12]; /* for LAN use */ + char Mdxflag; /* 01 if production .mdx, else 00 */ + char Language; /* Codepage */ + char Reserved3[2]; + + uint Records(void) const { return uint4korr(m_RecordsBuf); } + ushort Headlen(void) const { return uint2korr(m_HeadlenBuf); } + ushort Reclen(void) const { return uint2korr(m_ReclenBuf); } + ushort Fields(void) const { return uint2korr(m_FieldsBuf); } + + void SetHeadlen(ushort num) { int2store(m_HeadlenBuf, num); } + void SetReclen(ushort num) { int2store(m_ReclenBuf, num); } + void SetFields(ushort num) { int2store(m_FieldsBuf, num); } +} DBFHEADER; + +/****************************************************************************/ +/* Column field descriptor of a .dbf file. */ +/****************************************************************************/ +typedef struct _descriptor { + char Name[11]; /* field name, in capitals, null filled*/ + char Type; /* field type, C, D, F, L, M or N */ + uint Offset; /* used in memvars, not in files. */ + uchar Length; /* field length */ + uchar Decimals; /* number of decimal places */ + short Reserved4; + char Workarea; /* ??? */ + char Reserved5[2]; + char Setfield; /* ??? */ + char Reserved6[7]; + char Mdxfield; /* 01 if tag field in production .mdx */ +} DESCRIPTOR; + bool ZipLoadFile(PGLOBAL g, PCSZ zfn, PCSZ fn, PCSZ entry, bool append, bool mul); /***********************************************************************/ @@ -214,10 +270,21 @@ bool ZipLoadFile(PGLOBAL g, PCSZ zfn, PCSZ fn, PCSZ entry, bool append, bool mul buf = (char*)PlugSubAlloc(g, NULL, WRITEBUFFERSIZE); - if (mul) - err = ZipFiles(g, zutp, fn, buf); - else - err = ZipFile(g, zutp, fn, entry, buf); + if (!mul) { + PCSZ entp; + + if (!entry) { // entry defaults to the file name + char* p = strrchr((char*)fn, '/'); +#if defined(__WIN__) + if (!p) p = strrchr((char*)fn, '\\'); +#endif // __WIN__ + entp = (p) ? p + 1 : entry; + } else + entp = entry; + + err = ZipFile(g, zutp, fn, entp, buf); + } else + err = ZipFiles(g, zutp, fn, buf); zutp->close(); return err; @@ -232,6 +299,7 @@ ZIPUTIL::ZIPUTIL(PCSZ tgt) { zipfile = NULL; target = tgt; + pwd = NULL; fp = NULL; entryopen = false; } // end of ZIPUTIL standard constructor @@ -241,6 +309,7 @@ ZIPUTIL::ZIPUTIL(ZIPUTIL *zutp) { zipfile = zutp->zipfile; target = zutp->target; + pwd = zutp->pwd; fp = zutp->fp; entryopen = zutp->entryopen; } // end of UNZIPUTL copy constructor @@ -385,11 +454,11 @@ void ZIPUTIL::closeEntry() /***********************************************************************/ /* Constructors. */ /***********************************************************************/ -UNZIPUTL::UNZIPUTL(PCSZ tgt, bool mul) +UNZIPUTL::UNZIPUTL(PCSZ tgt, PCSZ pw, bool mul) { zipfile = NULL; target = tgt; - pwd = NULL; + pwd = pw; fp = NULL; memory = NULL; size = 0; @@ -959,7 +1028,7 @@ int UZXFAM::Cardinality(PGLOBAL g) } // end of Cardinality /***********************************************************************/ -/* OpenTableFile: Open a DOS/UNIX table file from a ZIP file. */ +/* OpenTableFile: Open a FIX/UNIX table file from a ZIP file. */ /***********************************************************************/ bool UZXFAM::OpenTableFile(PGLOBAL g) { @@ -1015,6 +1084,197 @@ int UZXFAM::GetNext(PGLOBAL g) return RC_OK; } // end of GetNext +/* -------------------------- class UZDFAM --------------------------- */ + +/***********************************************************************/ +/* Constructors. */ +/***********************************************************************/ +UZDFAM::UZDFAM(PDOSDEF tdp) : DBMFAM(tdp) +{ + zutp = NULL; + tdfp = tdp; + //target = tdp->GetEntry(); + //mul = tdp->GetMul(); + //Lrecl = tdp->GetLrecl(); +} // end of UZXFAM standard constructor + +UZDFAM::UZDFAM(PUZDFAM txfp) : DBMFAM(txfp) +{ + zutp = txfp->zutp; + tdfp = txfp->tdfp; + //target = txfp->target; + //mul = txfp->mul; + //Lrecl = txfp->Lrecl; +} // end of UZXFAM copy constructor + +#if 0 +/****************************************************************************/ +/* dbfhead: Routine to analyze a DBF header. */ +/* Parameters: */ +/* PGLOBAL g -- pointer to the CONNECT Global structure */ +/* DBFHEADER *hdrp -- pointer to _dbfheader structure */ +/* Returns: */ +/* RC_OK, RC_NF, RC_INFO, or RC_FX if error. */ +/* Side effects: */ +/* Set the fields number in the header. */ +/****************************************************************************/ +int UZDFAM::dbfhead(PGLOBAL g, void* buf) +{ + char *endmark; + int dbc = 2, rc = RC_OK; + DBFHEADER* hdrp = (DBFHEADER*)buf; + + *g->Message = '\0'; + + // Check first byte to be sure of .dbf type + if ((hdrp->Version & 0x03) != DBFTYPE) { + strcpy(g->Message, MSG(NOT_A_DBF_FILE)); + rc = RC_INFO; + + if ((hdrp->Version & 0x30) == 0x30) { + strcpy(g->Message, MSG(FOXPRO_FILE)); + dbc = 264; // FoxPro database container + } // endif Version + + } else + strcpy(g->Message, MSG(DBASE_FILE)); + + // Check last byte(s) of header + endmark = (char*)hdrp + hdrp->Headlen() - dbc; + + // Some headers just have 1D others have 1D00 following fields + if (endmark[0] != EOH && endmark[1] != EOH) { + sprintf(g->Message, MSG(NO_0DH_HEAD), dbc); + + if (rc == RC_OK) + return RC_FX; + + } // endif endmark + + // Calculate here the number of fields while we have the dbc info + hdrp->SetFields((hdrp->Headlen() - dbc - 1) / 32); + return rc; +} // end of dbfhead + +/****************************************************************************/ +/* ScanHeader: scan the DBF file header for number of records, record size,*/ +/* and header length. Set Records, check that Reclen is equal to lrecl and */ +/* return the header length or 0 in case of error. */ +/****************************************************************************/ +int UZDFAM::ScanHeader(PGLOBAL g, int* rln) +{ + int rc; + DBFHEADER header; + + /************************************************************************/ + /* Get the first 32 bytes of the header. */ + /************************************************************************/ + rc = dbfhead(g, &header); + + if (rc == RC_FX) + return -1; + + *rln = (int)header.Reclen(); + Records = (int)header.Records(); + return (int)header.Headlen(); +} // end of ScanHeader +#endif // 0 + +/***********************************************************************/ +/* ZIP GetFileLength: returns file size in number of bytes. */ +/***********************************************************************/ +int UZDFAM::GetFileLength(PGLOBAL g) +{ + int len; + + if (!zutp && OpenTableFile(g)) + return 0; + + if (zutp->entryopen) + len = zutp->size; + else + len = 0; + + return len; +} // end of GetFileLength + +/***********************************************************************/ +/* ZIP Cardinality: return the number of rows if possible. */ +/***********************************************************************/ +int UZDFAM::Cardinality(PGLOBAL g) +{ + if (!g) + return 1; + + int card = -1; + int len = GetFileLength(g); + + card = Records; + + // Set number of blocks for later use + Block = (card > 0) ? (card + Nrec - 1) / Nrec : 0; + return card; +} // end of Cardinality + +/***********************************************************************/ +/* OpenTableFile: Open a DBF table file from a ZIP file. */ +/***********************************************************************/ +bool UZDFAM::OpenTableFile(PGLOBAL g) +{ + // May have been already opened in GetFileLength + if (!zutp || !zutp->zipfile) { + char filename[_MAX_PATH]; + MODE mode = Tdbp->GetMode(); + + /*********************************************************************/ + /* Allocate the ZIP utility class. */ + /*********************************************************************/ + if (!zutp) + zutp = new(g)UNZIPUTL(tdfp); + + // We used the file name relative to recorded datapath + PlugSetPath(filename, To_File, Tdbp->GetPath()); + + if (!zutp->OpenTable(g, mode, filename)) { + // The pseudo "buffer" is here the entire real buffer + Memory = zutp->memory; + Top = Memory + zutp->size; + To_Fb = zutp->fp; // Useful when closing + return AllocateBuffer(g); + } else + return true; + + } else + Reset(); + + return false; +} // end of OpenTableFile + +/***********************************************************************/ +/* GetNext: go to next entry. */ +/***********************************************************************/ +int UZDFAM::GetNext(PGLOBAL g) +{ + int rc = zutp->nextEntry(g); + + if (rc != RC_OK) + return rc; + + int len = zutp->size; + +#if 0 + if (len % Lrecl) { + sprintf(g->Message, MSG(NOT_FIXED_LEN), zutp->fn, len, Lrecl); + return RC_FX; + } // endif size +#endif // 0 + + Memory = zutp->memory; + Top = Memory + len; + Rewind(); + return RC_OK; +} // end of GetNext + /* -------------------------- class ZIPFAM --------------------------- */ /***********************************************************************/ @@ -1045,7 +1305,7 @@ bool ZIPFAM::OpenTableFile(PGLOBAL g) strcpy(g->Message, "No insert into existing zip file"); return true; } else if (append && len > 0) { - UNZIPUTL *zutp = new(g) UNZIPUTL(target, false); + UNZIPUTL *zutp = new(g) UNZIPUTL(target, NULL, false); if (!zutp->IsInsertOk(g, filename)) { strcpy(g->Message, "No insert into existing entry"); @@ -1129,7 +1389,7 @@ bool ZPXFAM::OpenTableFile(PGLOBAL g) strcpy(g->Message, "No insert into existing zip file"); return true; } else if (append && len > 0) { - UNZIPUTL *zutp = new(g) UNZIPUTL(target, false); + UNZIPUTL *zutp = new(g) UNZIPUTL(target, NULL, false); if (!zutp->IsInsertOk(g, filename)) { strcpy(g->Message, "No insert into existing entry"); diff --git a/storage/connect/filamzip.h b/storage/connect/filamzip.h index be17d954728..7ff1fb0a543 100644 --- a/storage/connect/filamzip.h +++ b/storage/connect/filamzip.h @@ -1,7 +1,7 @@ /************** filamzip H Declares Source Code File (.H) **************/ -/* Name: filamzip.h Version 1.2 */ +/* Name: filamzip.h Version 1.3 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 2016-2017 */ +/* (C) Copyright to the author Olivier BERTRAND 2016-2020 */ /* */ /* This file contains the ZIP file access method classes declares. */ /***********************************************************************/ @@ -11,6 +11,7 @@ #include "block.h" #include "filamap.h" #include "filamfix.h" +#include "filamdbf.h" #include "zip.h" #include "unzip.h" @@ -18,6 +19,7 @@ typedef class UNZFAM *PUNZFAM; typedef class UZXFAM *PUZXFAM; +typedef class UZDFAM* PUZDFAM; typedef class ZIPFAM *PZIPFAM; typedef class ZPXFAM *PZPXFAM; @@ -53,7 +55,7 @@ class DllExport ZIPUTIL : public BLOCK { class DllExport UNZIPUTL : public BLOCK { public: // Constructor - UNZIPUTL(PCSZ tgt, bool mul); + UNZIPUTL(PCSZ tgt, PCSZ pw, bool mul); UNZIPUTL(PDOSDEF tdp); // Implementation @@ -143,6 +145,36 @@ class DllExport UZXFAM : public MPXFAM { PDOSDEF tdfp; }; // end of UZXFAM +/***********************************************************************/ +/* This is the fixed unzip file access method. */ +/***********************************************************************/ +class DllExport UZDFAM : public DBMFAM { + //friend class UNZFAM; +public: + // Constructors + UZDFAM(PDOSDEF tdp); + UZDFAM(PUZDFAM txfp); + + // Implementation + virtual AMT GetAmType(void) { return TYPE_AM_ZIP; } + virtual PTXF Duplicate(PGLOBAL g) { return (PTXF) new(g)UZDFAM(this); } + + // Methods + virtual int GetFileLength(PGLOBAL g); + virtual int Cardinality(PGLOBAL g); + virtual bool OpenTableFile(PGLOBAL g); + virtual int GetNext(PGLOBAL g); + //virtual int ReadBuffer(PGLOBAL g); + +protected: + int dbfhead(PGLOBAL g, void* buf); + int ScanHeader(PGLOBAL g, int* rln); + + // Members + UNZIPUTL* zutp; + PDOSDEF tdfp; +}; // end of UZDFAM + /***********************************************************************/ /* This is the zip file access method. */ /***********************************************************************/ diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 105ebf0545b..7d53f287f74 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -5884,7 +5884,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, } else switch (ttp) { case TAB_DBF: - qrp= DBFColumns(g, dpath, fn, fnc == FNC_COL); + qrp= DBFColumns(g, dpath, fn, topt, fnc == FNC_COL); break; #if defined(ODBC_SUPPORT) case TAB_ODBC: @@ -6735,11 +6735,6 @@ int ha_connect::create(const char *name, TABLE *table_arg, PCSZ m= GetListOption(g, "Mulentries", options->oplist, "NO"); bool mul= *m == '1' || *m == 'Y' || *m == 'y' || !stricmp(m, "ON"); - if (!entry && !mul) { - my_message(ER_UNKNOWN_ERROR, "Missing entry name", MYF(0)); - DBUG_RETURN(HA_ERR_INTERNAL_ERROR); - } // endif entry - strcat(strcat(strcpy(dbpath, "./"), table->s->db.str), "/"); PlugSetPath(zbuf, options->filename, dbpath); PlugSetPath(buf, fn, dbpath); diff --git a/storage/connect/mongo.cpp b/storage/connect/mongo.cpp index 53e2bf377c4..bd3d3b893c1 100644 --- a/storage/connect/mongo.cpp +++ b/storage/connect/mongo.cpp @@ -380,7 +380,6 @@ MGODEF::MGODEF(void) Uri = NULL; Colist = NULL; Filter = NULL; - Level = 0; Base = 0; Version = 0; Pipe = false; diff --git a/storage/connect/mongo.h b/storage/connect/mongo.h index 97c391a217f..dcefac372c0 100644 --- a/storage/connect/mongo.h +++ b/storage/connect/mongo.h @@ -82,7 +82,6 @@ protected: PSZ Wrapname; /* Java wrapper name */ PCSZ Colist; /* Options list */ PCSZ Filter; /* Filtering query */ - int Level; /* Used for catalog table */ int Base; /* The array index base */ int Version; /* The Java driver version */ bool Pipe; /* True is Colist is a pipeline */ diff --git a/storage/connect/plgxml.cpp b/storage/connect/plgxml.cpp index f3d3a010266..8c5cc261899 100644 --- a/storage/connect/plgxml.cpp +++ b/storage/connect/plgxml.cpp @@ -49,7 +49,7 @@ bool XMLDOCUMENT::InitZip(PGLOBAL g, PCSZ entry) { #if defined(ZIP_SUPPORT) bool mul = (entry) ? strchr(entry, '*') || strchr(entry, '?') : false; - zip = new(g) UNZIPUTL(entry, mul); + zip = new(g) UNZIPUTL(entry, NULL, mul); return zip == NULL; #else // !ZIP_SUPPORT sprintf(g->Message, MSG(NO_FEAT_SUPPORT), "ZIP"); diff --git a/storage/connect/tabdos.cpp b/storage/connect/tabdos.cpp index 8efe2aad702..b3147bb7357 100644 --- a/storage/connect/tabdos.cpp +++ b/storage/connect/tabdos.cpp @@ -1,11 +1,11 @@ /************* TabDos C++ Program Source Code File (.CPP) **************/ /* PROGRAM NAME: TABDOS */ /* ------------- */ -/* Version 4.9.4 */ +/* Version 4.9.5 */ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 1998-2019 */ +/* (C) Copyright to the author Olivier BERTRAND 1998-2020 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -359,7 +359,26 @@ PTDB DOSDEF::GetTable(PGLOBAL g, MODE mode) /* Allocate table and file processing class of the proper type. */ /* Column blocks will be allocated only when needed. */ /*********************************************************************/ - if (Zipped) { + if (Recfm == RECFM_DBF) { + if (Catfunc == FNC_NO) { + if (Zipped) { + if (mode == MODE_READ || mode == MODE_ANY || mode == MODE_ALTER) { + txfp = new(g) UZDFAM(this); + } else { + strcpy(g->Message, "Zipped DBF tables are read only"); + return NULL; + } // endif's mode + + } else if (map) + txfp = new(g) DBMFAM(this); + else + txfp = new(g) DBFFAM(this); + + tdbp = new(g) TDBFIX(this, txfp); + } else + tdbp = new(g) TDBDCL(this); // Catfunc should be 'C' + + } else if (Zipped) { #if defined(ZIP_SUPPORT) if (Recfm == RECFM_VAR) { if (mode == MODE_READ || mode == MODE_ANY || mode == MODE_ALTER) { @@ -389,17 +408,6 @@ PTDB DOSDEF::GetTable(PGLOBAL g, MODE mode) sprintf(g->Message, MSG(NO_FEAT_SUPPORT), "ZIP"); return NULL; #endif // !ZIP_SUPPORT - } else if (Recfm == RECFM_DBF) { - if (Catfunc == FNC_NO) { - if (map) - txfp = new(g) DBMFAM(this); - else - txfp = new(g) DBFFAM(this); - - tdbp = new(g) TDBFIX(this, txfp); - } else // Catfunc should be 'C' - tdbp = new(g) TDBDCL(this); - } else if (Recfm != RECFM_VAR && Compressed < 2) { if (Huge) txfp = new(g) BGXFAM(this); diff --git a/storage/connect/tabdos.h b/storage/connect/tabdos.h index 207a1277fce..80dfe63845d 100644 --- a/storage/connect/tabdos.h +++ b/storage/connect/tabdos.h @@ -30,6 +30,7 @@ class DllExport DOSDEF : public TABDEF { /* Logical table description */ friend class DBFBASE; friend class UNZIPUTL; friend class JSONCOL; + friend class TDBDCL; public: // Constructor DOSDEF(void); diff --git a/storage/connect/tabfix.h b/storage/connect/tabfix.h index 53c0af1c422..5f859a2bffe 100644 --- a/storage/connect/tabfix.h +++ b/storage/connect/tabfix.h @@ -98,18 +98,20 @@ class DllExport BINCOL : public DOSCOL { /* This is the class declaration for the DBF columns catalog table. */ /***********************************************************************/ class TDBDCL : public TDBCAT { - public: - // Constructor - TDBDCL(PDOSDEF tdp) : TDBCAT(tdp) {Fn = tdp->GetFn();} +public: + // Constructor + TDBDCL(PDOSDEF tdp) : TDBCAT(tdp) + {Fn = tdp->GetFn(); Topt = tdp->GetTopt();} - protected: +protected: // Specific routines - virtual PQRYRES GetResult(PGLOBAL g) - {return DBFColumns(g, ((PTABDEF)To_Def)->GetPath(), Fn, false);} + virtual PQRYRES GetResult(PGLOBAL g) + {return DBFColumns(g, ((PTABDEF)To_Def)->GetPath(), Fn, Topt, false);} - // Members + // Members PCSZ Fn; // The DBF file (path) name - }; // end of class TDBOCL + PTOS Topt; +}; // end of class TDBOCL #endif // __TABFIX__ diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index 7e8d6c8d9f0..3b0d458a7a6 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -739,6 +739,7 @@ PTDB JSONDEF::GetTable(PGLOBAL g, MODE m) /***********************************************************************/ TDBJSN::TDBJSN(PJDEF tdp, PTXF txfp) : TDBDOS(tdp, txfp) { + G = NULL; Top = NULL; Row = NULL; Val = NULL; diff --git a/storage/connect/tabjson.h b/storage/connect/tabjson.h index 8721a2a5ab7..8c3f1013919 100644 --- a/storage/connect/tabjson.h +++ b/storage/connect/tabjson.h @@ -104,7 +104,6 @@ public: PCSZ Xcol; /* Name of expandable column */ int Limit; /* Limit of multiple values */ int Pretty; /* Depends on file structure */ - int Level; /* Used for catalog table */ int Base; /* The array index base */ bool Strict; /* Strict syntax checking */ char Sep; /* The Jpath separator */ From ad0d2424dd72d7414e9c26ca0c50d67710c50af7 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Mon, 13 Jul 2020 20:02:51 +0200 Subject: [PATCH 03/35] Fix compile error for KVM. Modified filamdbf.cpp --- storage/connect/filamdbf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/connect/filamdbf.cpp b/storage/connect/filamdbf.cpp index 8278ff4ceec..542159fd172 100644 --- a/storage/connect/filamdbf.cpp +++ b/storage/connect/filamdbf.cpp @@ -189,7 +189,7 @@ static int dbfhead(PGLOBAL g, FILE *file, PCSZ fn, DBFHEADER *buf) /* Returns: */ /* RC_OK, RC_INFO, or RC_FX if error. */ /****************************************************************************/ -int dbfields(PGLOBAL g, DBFHEADER* hdrp) +static int dbfields(PGLOBAL g, DBFHEADER* hdrp) { char* endmark; int dbc = 2, rc = RC_OK; From 62d73df6b270cc94ba577e96d3bf325170f306fe Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Wed, 22 Jul 2020 14:44:25 +0530 Subject: [PATCH 04/35] MDEV-19232: Floating point precision / value comparison problem The issue occurs when the subquery_cache is enabled. When there is a cache miss the division was leading to a value with scale 9. In the case of cache hit the value returned was of scale 9 and due to the different values for the scales the where condition evaluated to FALSE, hence the output was incomplete. To fix this problem we need to round up the decimal to the limit mentioned in Item::decimals. This would make sure the values are compared with the same scale. --- mysql-test/r/func_group.result | 4 +-- mysql-test/r/parser_precedence.result | 2 +- mysql-test/r/subselect4.result | 24 +++++++++++++++++ mysql-test/r/type_newdecimal.result | 5 ---- mysql-test/r/type_ranges.result | 6 ++--- .../r/div_precision_increment_func.result | 16 ++++++------ mysql-test/suite/vcol/r/not_supported.result | 2 +- mysql-test/t/subselect4.test | 26 +++++++++++++++++++ sql/item_func.cc | 2 ++ .../tokudb/r/type_newdecimal.result | 5 ---- .../mysql-test/tokudb/r/type_ranges.result | 6 ++--- 11 files changed, 68 insertions(+), 30 deletions(-) diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 06323f5b3bb..d0d413331df 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -1186,13 +1186,13 @@ i count(*) std(e1/e2) 3 4 0.00000000 select std(s1/s2) from bug22555; std(s1/s2) -0.21325764 +0.21328517 select std(o1/o2) from bug22555; std(o1/o2) 0.2132576358664934 select std(e1/e2) from bug22555; std(e1/e2) -0.21325764 +0.21328517 set @saved_div_precision_increment=@@div_precision_increment; set div_precision_increment=19; select i, count(*), std(s1/s2) from bug22555 group by i order by i; diff --git a/mysql-test/r/parser_precedence.result b/mysql-test/r/parser_precedence.result index 4330c8a2045..f23295bd61b 100644 --- a/mysql-test/r/parser_precedence.result +++ b/mysql-test/r/parser_precedence.result @@ -619,7 +619,7 @@ select 4 - 3 * 2, (4 - 3) * 2, 4 - (3 * 2); Testing that / is left associative select 15 / 5 / 3, (15 / 5) / 3, 15 / (5 / 3); 15 / 5 / 3 (15 / 5) / 3 15 / (5 / 3) -1.00000000 1.00000000 9.0000 +1.00000000 1.00000000 8.9998 Testing that / has precedence over | select 105 / 5 | 2, (105 / 5) | 2, 105 / (5 | 2); 105 / 5 | 2 (105 / 5) | 2 105 / (5 | 2) diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result index 22d4938fb78..606ab847028 100644 --- a/mysql-test/r/subselect4.result +++ b/mysql-test/r/subselect4.result @@ -2584,3 +2584,27 @@ l1 i2 e 2 o 6 DROP TABLE t1, t2; +# +# MDEV-19232: Floating point precision / value comparison problem +# +CREATE TABLE t1 (region varchar(60), area decimal(10,0), population decimal(11,0)); +INSERT INTO t1 VALUES ('Central America and the Caribbean',91,11797); +INSERT INTO t1 VALUES ('Central America and the Caribbean',442,66422); +SET @save_optimizer_switch=@@optimizer_switch; +SET optimizer_switch='subquery_cache=on'; +SELECT +population, area, population/area, +cast(population/area as DECIMAL(20,9)) FROM t1 LIMIT 1; +population area population/area cast(population/area as DECIMAL(20,9)) +11797 91 129.6374 129.637400000 +SELECT * FROM t1 A +WHERE population/area = (SELECT MAX(population/area) from t1 B where A.region = B.region); +region area population +Central America and the Caribbean 442 66422 +SET optimizer_switch='subquery_cache=off'; +SELECT * FROM t1 A +WHERE population/area = (SELECT MAX(population/area) from t1 B where A.region = B.region); +region area population +Central America and the Caribbean 442 66422 +SET @@optimizer_switch= @save_optimizer_switch; +DROP TABLE t1; diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index dc6ef3c59e2..7b6629bc7b2 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -1530,11 +1530,8 @@ select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 * 1.01500000 * 1.01500000 * 0.99500000) 0.812988073953673124592306939480 create table t1 as select 5.05 / 0.014; -Warnings: -Note 1265 Data truncated for column '5.05 / 0.014' at row 1 show warnings; Level Code Message -Note 1265 Data truncated for column '5.05 / 0.014' at row 1 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1649,8 +1646,6 @@ my_col 0.123456789123456789123456789123 DROP TABLE t1; CREATE TABLE t1 SELECT 1 / .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS my_col; -Warnings: -Note 1265 Data truncated for column 'my_col' at row 1 DESCRIBE t1; Field Type Null Key Default Extra my_col decimal(65,4) YES NULL diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result index 101bf0cfb2c..a10d2a56eae 100644 --- a/mysql-test/r/type_ranges.result +++ b/mysql-test/r/type_ranges.result @@ -94,8 +94,6 @@ DROP INDEX test ON t1; insert into t1 values (10, 1,1,1,1,1,1,1,1,1,1,1,1,1,NULL,0,0,0,1,1,1,1,'one','one'); insert into t1 values (NULL,2,2,2,2,2,2,2,2,2,2,2,2,2,NULL,NULL,NULL,NULL,NULL,NULL,2,2,'two','two,one'); insert into t1 values (0,1/3,3,3,3,3,3,3,3,3,3,3,3,3,NULL,'19970303','10:10:10','19970303101010','','','','3',3,3); -Warnings: -Warning 1265 Data truncated for column 'string' at row 1 insert into t1 values (0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,19970807,080706,19970403090807,-1,-1,-1,'-1',-1,-1); Warnings: Warning 1264 Out of range value for column 'utiny' at row 1 @@ -136,7 +134,7 @@ select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,ut auto string tiny short medium long_int longlong real_float real_double utiny ushort umedium ulong ulonglong mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000) date_field time_field date_time blob_col tinyblob_col mediumblob_col longblob_col 10 1 1 1 1 1 1 1.0 1.0000 1 00001 1 1 1 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 1 1 1 11 2 2 2 2 2 2 2.0 2.0000 2 00002 2 2 2 0 NULL NULL NULL NULL NULL 2 2 -12 0.33333333 3 3 3 3 3 3.0 3.0000 3 00003 3 3 3 0 1997-03-03 10:10:10 1997-03-03 10:10:10 3 +12 0.3333 3 3 3 3 3 3.0 3.0000 3 00003 3 3 3 0 1997-03-03 10:10:10 1997-03-03 10:10:10 3 13 -1 -1 -1 -1 -1 -1 -1.0 -1.0000 0 00000 0 0 0 0 1997-08-07 08:07:06 1997-04-03 09:08:07 -1 -1 -1 -1 14 -429496729 -128 -32768 -8388608 -2147483648 -4294967295 -4294967296.0 -4294967295.0000 0 00000 0 0 0 0 0000-00-00 00:00:00 0000-00-00 00:00:00 -4294967295 -4294967295 -4294967295 -4294967295 15 4294967295 127 32767 8388607 2147483647 4294967295 4294967296.0 4294967295.0000 255 65535 16777215 4294967295 4294967295 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4294967295 4294967295 4294967295 4294967295 @@ -188,7 +186,7 @@ Warning 1265 Data truncated for column 'new_field' at row 7 select * from t2; auto string mediumblob_col new_field 1 2 2 ne -2 0.33333333 ne +2 0.3333 ne 3 -1 -1 ne 4 -429496729 -4294967295 ne 5 4294967295 4294967295 ne diff --git a/mysql-test/suite/sys_vars/r/div_precision_increment_func.result b/mysql-test/suite/sys_vars/r/div_precision_increment_func.result index ee8b7c5691d..ffe23eb3cef 100644 --- a/mysql-test/suite/sys_vars/r/div_precision_increment_func.result +++ b/mysql-test/suite/sys_vars/r/div_precision_increment_func.result @@ -50,9 +50,9 @@ INSERT into t1(name, salary, income_tax) values('Record_2', 501, 501*2.5/1000); INSERT into t1(name, salary, income_tax) values('Record_3', 210, 210*2.5/1000); SELECT * from t1; id name salary income_tax -1 Record_1 100011 250.027 -2 Record_2 501 1.2525 -3 Record_3 210 0.525 +1 Record_1 100011 250.03 +2 Record_2 501 1.25 +3 Record_3 210 0.53 ## Creating new connection ## ## Verifying session & global value of variable ## SELECT @@global.div_precision_increment = 2; @@ -67,11 +67,11 @@ INSERT into t1(name, salary, income_tax) values('Record_5', 501, 501*2.5/1000); INSERT into t1(name, salary, income_tax) values('Record_6', 210, 210*2.5/1000); SELECT * from t1; id name salary income_tax -1 Record_1 100011 250.027 -2 Record_2 501 1.2525 -3 Record_3 210 0.525 -4 Record_4 100011 250.027 -5 Record_5 501 1.2525 +1 Record_1 100011 250.03 +2 Record_2 501 1.25 +3 Record_3 210 0.53 +4 Record_4 100011 250.028 +5 Record_5 501 1.253 6 Record_6 210 0.525 ## Dropping table t1 ## drop table t1; diff --git a/mysql-test/suite/vcol/r/not_supported.result b/mysql-test/suite/vcol/r/not_supported.result index 06627fccf8b..a3b73d3444f 100644 --- a/mysql-test/suite/vcol/r/not_supported.result +++ b/mysql-test/suite/vcol/r/not_supported.result @@ -51,7 +51,7 @@ a b v flush tables; select * from t1; a b v -1 2 0.3333333330000000000 +1 2 0.3333000000000000000 select * from t5; a b v 20141010 2 October diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test index b7a9c95abe7..21ec28b1c03 100644 --- a/mysql-test/t/subselect4.test +++ b/mysql-test/t/subselect4.test @@ -2112,3 +2112,29 @@ INSERT INTO t2 VALUES ('k'),('rid'),('f'),('x'); EXPLAIN EXTENDED SELECT * FROM t1 where ( t1.l1 < ANY (SELECT MAX(t2.v1) FROM t2)); SELECT * FROM t1 where ( t1.l1 < ANY (SELECT MAX(t2.v1) FROM t2)); DROP TABLE t1, t2; + +--echo # +--echo # MDEV-19232: Floating point precision / value comparison problem +--echo # + +CREATE TABLE t1 (region varchar(60), area decimal(10,0), population decimal(11,0)); +INSERT INTO t1 VALUES ('Central America and the Caribbean',91,11797); +INSERT INTO t1 VALUES ('Central America and the Caribbean',442,66422); + +SET @save_optimizer_switch=@@optimizer_switch; +SET optimizer_switch='subquery_cache=on'; + +SELECT +population, area, population/area, +cast(population/area as DECIMAL(20,9)) FROM t1 LIMIT 1; + +SELECT * FROM t1 A +WHERE population/area = (SELECT MAX(population/area) from t1 B where A.region = B.region); + +SET optimizer_switch='subquery_cache=off'; +SELECT * FROM t1 A +WHERE population/area = (SELECT MAX(population/area) from t1 B where A.region = B.region); + +SET @@optimizer_switch= @save_optimizer_switch; + +DROP TABLE t1; diff --git a/sql/item_func.cc b/sql/item_func.cc index c41d7809bf9..5e605855d80 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1719,6 +1719,8 @@ my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value) null_value= 1; return 0; } + my_decimal_round(E_DEC_FATAL_ERROR, decimal_value, + decimals, FALSE, decimal_value); return decimal_value; } diff --git a/storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result b/storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result index 7d5b555488e..dd47b8a1a5c 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result @@ -1531,11 +1531,8 @@ select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 * 1.01500000 * 1.01500000 * 0.99500000) 0.812988073953673124592306939480 create table t1 as select 5.05 / 0.014; -Warnings: -Note 1265 Data truncated for column '5.05 / 0.014' at row 1 show warnings; Level Code Message -Note 1265 Data truncated for column '5.05 / 0.014' at row 1 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1650,8 +1647,6 @@ my_col 0.123456789123456789123456789123 DROP TABLE t1; CREATE TABLE t1 SELECT 1 / .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS my_col; -Warnings: -Note 1265 Data truncated for column 'my_col' at row 1 DESCRIBE t1; Field Type Null Key Default Extra my_col decimal(65,4) YES NULL diff --git a/storage/tokudb/mysql-test/tokudb/r/type_ranges.result b/storage/tokudb/mysql-test/tokudb/r/type_ranges.result index bd8491336b3..395f21a8a8f 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_ranges.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_ranges.result @@ -95,8 +95,6 @@ DROP INDEX test ON t1; insert into t1 values (10, 1,1,1,1,1,1,1,1,1,1,1,1,1,NULL,0,0,0,1,1,1,1,'one','one'); insert into t1 values (NULL,2,2,2,2,2,2,2,2,2,2,2,2,2,NULL,NULL,NULL,NULL,NULL,NULL,2,2,'two','two,one'); insert into t1 values (0,1/3,3,3,3,3,3,3,3,3,3,3,3,3,NULL,'19970303','10:10:10','19970303101010','','','','3',3,3); -Warnings: -Warning 1265 Data truncated for column 'string' at row 1 insert into t1 values (0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,19970807,080706,19970403090807,-1,-1,-1,'-1',-1,-1); Warnings: Warning 1264 Out of range value for column 'utiny' at row 1 @@ -137,7 +135,7 @@ select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,ut auto string tiny short medium long_int longlong real_float real_double utiny ushort umedium ulong ulonglong mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000) date_field time_field date_time blob_col tinyblob_col mediumblob_col longblob_col 10 1 1 1 1 1 1 1.0 1.0000 1 00001 1 1 1 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 1 1 1 11 2 2 2 2 2 2 2.0 2.0000 2 00002 2 2 2 0 NULL NULL NULL NULL NULL 2 2 -12 0.33333333 3 3 3 3 3 3.0 3.0000 3 00003 3 3 3 0 1997-03-03 10:10:10 1997-03-03 10:10:10 3 +12 0.3333 3 3 3 3 3 3.0 3.0000 3 00003 3 3 3 0 1997-03-03 10:10:10 1997-03-03 10:10:10 3 13 -1 -1 -1 -1 -1 -1 -1.0 -1.0000 0 00000 0 0 0 0 1997-08-07 08:07:06 1997-04-03 09:08:07 -1 -1 -1 -1 14 -429496729 -128 -32768 -8388608 -2147483648 -4294967295 -4294967296.0 -4294967295.0000 0 00000 0 0 0 0 0000-00-00 00:00:00 0000-00-00 00:00:00 -4294967295 -4294967295 -4294967295 -4294967295 15 4294967295 127 32767 8388607 2147483647 4294967295 4294967296.0 4294967295.0000 255 65535 16777215 4294967295 4294967295 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4294967295 4294967295 4294967295 4294967295 @@ -189,7 +187,7 @@ Warning 1265 Data truncated for column 'new_field' at row 7 select * from t2; auto string mediumblob_col new_field 1 2 2 ne -2 0.33333333 ne +2 0.3333 ne 3 -1 -1 ne 4 -429496729 -4294967295 ne 5 4294967295 4294967295 ne From d2982331a62e22ff10fd7768f450303bc90d1caf Mon Sep 17 00:00:00 2001 From: Ian Gilfillan Date: Tue, 14 Jul 2020 00:42:47 +0200 Subject: [PATCH 05/35] Code comment spellfixes --- sql/compat56.cc | 2 +- sql/debug_sync.cc | 4 ++-- sql/derror.cc | 2 +- sql/encryption.cc | 4 ++-- sql/event_data_objects.cc | 2 +- sql/event_db_repository.cc | 2 +- sql/event_parse_data.cc | 6 +++--- sql/event_queue.cc | 2 +- sql/events.cc | 2 +- sql/field.cc | 26 +++++++++++++------------- sql/field.h | 8 ++++---- sql/field_conv.cc | 2 +- sql/filesort.cc | 8 ++++---- sql/gcalc_slicescan.cc | 2 +- sql/gcalc_slicescan.h | 6 +++--- sql/gcalc_tools.cc | 4 ++-- sql/ha_partition.cc | 32 ++++++++++++++++---------------- sql/ha_partition.h | 6 +++--- sql/handler.cc | 12 ++++++------ sql/handler.h | 22 +++++++++++----------- sql/item.cc | 16 ++++++++-------- sql/item.h | 16 ++++++++-------- sql/item_buff.cc | 2 +- sql/item_cmpfunc.cc | 18 +++++++++--------- sql/item_cmpfunc.h | 2 +- sql/item_func.cc | 14 +++++++------- sql/item_inetfunc.cc | 8 ++++---- sql/item_strfunc.cc | 6 +++--- sql/item_subselect.cc | 36 ++++++++++++++++++------------------ sql/item_subselect.h | 8 ++++---- sql/item_sum.cc | 16 ++++++++-------- sql/item_sum.h | 2 +- sql/item_timefunc.cc | 24 ++++++++++++------------ sql/item_xmlfunc.cc | 20 ++++++++++---------- sql/key.cc | 2 +- sql/lex.h | 2 +- sql/lock.cc | 2 +- sql/log.cc | 20 ++++++++++---------- sql/log_event.cc | 38 +++++++++++++++++++------------------- sql/log_event.h | 18 +++++++++--------- sql/log_event_old.cc | 4 ++-- 41 files changed, 214 insertions(+), 214 deletions(-) diff --git a/sql/compat56.cc b/sql/compat56.cc index 1ffc8fd762d..eb11de9479f 100644 --- a/sql/compat56.cc +++ b/sql/compat56.cc @@ -290,7 +290,7 @@ uint my_datetime_binary_length(uint dec) /* On disk we store as unsigned number with DATETIMEF_INT_OFS offset, - for HA_KETYPE_BINARY compatibilty purposes. + for HA_KETYPE_BINARY compatibility purposes. */ #define DATETIMEF_INT_OFS 0x8000000000LL diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc index 105d868a175..591ce5800a8 100644 --- a/sql/debug_sync.cc +++ b/sql/debug_sync.cc @@ -33,7 +33,7 @@ /* Action to perform at a synchronization point. NOTE: This structure is moved around in memory by realloc(), qsort(), - and memmove(). Do not add objects with non-trivial constuctors + and memmove(). Do not add objects with non-trivial constructors or destructors, which might prevent moving of this structure with these functions. */ @@ -542,7 +542,7 @@ static void debug_sync_reset(THD *thd) @description Removing an action mainly means to decrement the ds_active counter. But if the action is between other active action in the array, then - the array needs to be shrinked. The active actions above the one to + the array needs to be shrunk. The active actions above the one to be removed have to be moved down by one slot. */ diff --git a/sql/derror.cc b/sql/derror.cc index b976fff9d4f..f7abcda1854 100644 --- a/sql/derror.cc +++ b/sql/derror.cc @@ -166,7 +166,7 @@ bool read_texts(const char *file_name, const char *language, MYF(0))) < 0) { /* - Trying pre-5.4 sematics of the --language parameter. + Trying pre-5.4 semantics of the --language parameter. It included the language-specific part, e.g.: --language=/path/to/english/ diff --git a/sql/encryption.cc b/sql/encryption.cc index ad23c80b8ab..4fac36dc97e 100644 --- a/sql/encryption.cc +++ b/sql/encryption.cc @@ -75,8 +75,8 @@ int initialize_encryption_plugin(st_plugin_int *plugin) (struct st_mariadb_encryption*) plugin->plugin->info; /* - Copmiler on Spark doesn't like the '?' operator here as it - belives the (uint (*)...) implies the C++ call model. + Compiler on Spark doesn't like the '?' operator here as it + believes the (uint (*)...) implies the C++ call model. */ if (handle->crypt_ctx_size) encryption_handler.encryption_ctx_size_func= handle->crypt_ctx_size; diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index 759bca08eea..51ee921c689 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -159,7 +159,7 @@ Event_creation_ctx::load_from_db(THD *thd, /*************************************************************************/ /* - Initiliazes dbname and name of an Event_queue_element_for_exec + Initializes dbname and name of an Event_queue_element_for_exec object SYNOPSIS diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 2928a059a0e..c89efec82a0 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -668,7 +668,7 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data, DBUG_PRINT("info", ("name: %.*s", (int) parse_data->name.length, parse_data->name.str)); - DBUG_PRINT("info", ("check existance of an event with the same name")); + DBUG_PRINT("info", ("check existence of an event with the same name")); if (!find_named_event(parse_data->dbname, parse_data->name, table)) { if (thd->lex->create_info.or_replace()) diff --git a/sql/event_parse_data.cc b/sql/event_parse_data.cc index 3dbcaba8bb0..92ba27a25a1 100644 --- a/sql/event_parse_data.cc +++ b/sql/event_parse_data.cc @@ -100,7 +100,7 @@ Event_parse_data::init_name(THD *thd, sp_name *spn) ENDS or AT is in the past, we are trying to create an event that will never be executed. If it has ON COMPLETION NOT PRESERVE (default), then it would normally be dropped already, so on CREATE - EVENT we give a warning, and do not create anyting. On ALTER EVENT + EVENT we give a warning, and do not create anything. On ALTER EVENT we give a error, and do not change the event. If the event has ON COMPLETION PRESERVE, then we see if the event is @@ -359,7 +359,7 @@ wrong_value: EVERY 5 MINUTE STARTS "2004-12-12 10:00:00" means that the event will be executed every 5 minutes but this will start at the date shown above. Expressions are possible : - DATE_ADD(NOW(), INTERVAL 1 DAY) -- start tommorow at + DATE_ADD(NOW(), INTERVAL 1 DAY) -- start tomorrow at same time. RETURN VALUE @@ -413,7 +413,7 @@ wrong_value: EVERY 5 MINUTE ENDS "2004-12-12 10:00:00" means that the event will be executed every 5 minutes but this will end at the date shown above. Expressions are possible : - DATE_ADD(NOW(), INTERVAL 1 DAY) -- end tommorow at + DATE_ADD(NOW(), INTERVAL 1 DAY) -- end tomorrow at same time. RETURN VALUE diff --git a/sql/event_queue.cc b/sql/event_queue.cc index 3a52da0241d..0e330bbdf03 100644 --- a/sql/event_queue.cc +++ b/sql/event_queue.cc @@ -357,7 +357,7 @@ Event_queue::drop_matching_events(THD *thd, LEX_STRING pattern, We don't call mysql_cond_broadcast(&COND_queue_state); If we remove the top event: 1. The queue is empty. The scheduler will wake up at some time and - realize that the queue is empty. If create_event() comes inbetween + realize that the queue is empty. If create_event() comes in between it will signal the scheduler 2. The queue is not empty, but the next event after the previous top, won't be executed any time sooner than the element we removed. Hence, diff --git a/sql/events.cc b/sql/events.cc index 6f2f17a5017..42ce5bfcaa4 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -128,7 +128,7 @@ bool Events::check_if_system_tables_error() /** Reconstructs interval expression from interval type and expression - value that is in form of a value of the smalles entity: + value that is in form of a value of the smallest entity: For YEAR_MONTH - expression is in months DAY_MINUTE - expression is in minutes diff --git a/sql/field.cc b/sql/field.cc index f65c6f88bb9..5f0d340a1a5 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -47,7 +47,7 @@ #define MAX_EXPONENT 1024 /***************************************************************************** - Instansiate templates and static variables + Instantiate templates and static variables *****************************************************************************/ static const char *zero_timestamp="0000-00-00 00:00:00.000000"; @@ -78,7 +78,7 @@ const char field_separator=','; /* Rules for merging different types of fields in UNION - NOTE: to avoid 256*256 table, gap in table types numeration is skiped + NOTE: to avoid 256*256 table, gap in table types numeration is skipped following #defines describe that gap and how to canculate number of fields and index of field in thia array. */ @@ -1374,7 +1374,7 @@ Item *Field_num::get_equal_zerofill_const_item(THD *thd, const Context &ctx, /** - Contruct warning parameters using thd->no_errors +Construct warning parameters using thd->no_errors to determine whether to generate or suppress warnings. We can get here in a query like this: SELECT COUNT(@@basedir); @@ -1422,7 +1422,7 @@ Value_source::Converter_string_to_number::check_edom_and_truncation(THD *thd, if (filter.want_warning_edom()) { /* - We can use err.ptr() here as ErrConvString is guranteed to put an + We can use err.ptr() here as ErrConvString is guaranteed to put an end \0 here. */ THD *wthd= thd ? thd : current_thd; @@ -1454,7 +1454,7 @@ Value_source::Converter_string_to_number::check_edom_and_truncation(THD *thd, - found garbage at the end of the string. @param type Data type name (e.g. "decimal", "integer", "double") - @param edom Indicates that the string-to-number routine retuned + @param edom Indicates that the string-to-number routine returned an error code equivalent to EDOM (value out of domain), i.e. the string fully consisted of garbage and the conversion routine could not get any digits from it. @@ -1518,7 +1518,7 @@ int Field_num::check_edom_and_truncation(const char *type, bool edom, /* - Conver a string to an integer then check bounds. + Convert a string to an integer then check bounds. SYNOPSIS Field_num::get_int @@ -2486,7 +2486,7 @@ int Field_decimal::store(const char *from_arg, uint len, CHARSET_INFO *cs) We only have to generate warnings if count_cuted_fields is set. This is to avoid extra checks of the number when they are not needed. Even if this flag is not set, it's OK to increment warnings, if - it makes the code easer to read. + it makes the code easier to read. */ if (get_thd()->count_cuted_fields) @@ -2569,7 +2569,7 @@ int Field_decimal::store(const char *from_arg, uint len, CHARSET_INFO *cs) } /* - Now write the formated number + Now write the formatted number First the digits of the int_% parts. Do we have enough room to write these digits ? @@ -3129,7 +3129,7 @@ int Field_new_decimal::store(const char *from, uint length, If check_decimal() failed because of EDOM-alike error, (e.g. E_DEC_BAD_NUM), we have to initialize decimal_value to zero. Note: if check_decimal() failed because of truncation, - decimal_value is alreay properly initialized. + decimal_value is already properly initialized. */ my_decimal_set_zero(&decimal_value); /* @@ -4936,7 +4936,7 @@ Field_timestamp::Field_timestamp(uchar *ptr_arg, uint32 len_arg, { /* We mark the flag with TIMESTAMP_FLAG to indicate to the client that - this field will be automaticly updated on insert. + this field will be automatically updated on insert. */ flags|= TIMESTAMP_FLAG; if (unireg_check != TIMESTAMP_DN_FIELD) @@ -7345,7 +7345,7 @@ Field_string::unpack(uchar *to, const uchar *from, const uchar *from_end, with the real type. Since all allowable types have 0xF as most significant bits of the metadata word, lengths <256 will not affect the real type at all, while all other values will result in a - non-existant type in the range 17-244. + non-existent type in the range 17-244. @see Field_string::unpack @@ -9871,7 +9871,7 @@ void Create_field::init_for_tmp_table(enum_field_types sql_type_arg, /* Set the pack flag correctly for the blob-like types. This sets the packtype to something that make_field can use. If the pack type is - not set correctly, the packlength will be reeeeally wierd (like + not set correctly, the packlength will be reeeeally weird (like 129 or so). */ switch (sql_type_arg) @@ -10079,7 +10079,7 @@ bool Create_field::check(THD *thd) break; case MYSQL_TYPE_VARCHAR: /* - Long VARCHAR's are automaticly converted to blobs in mysql_prepare_table + Long VARCHAR's are automatically converted to blobs in mysql_prepare_table if they don't have a default value */ max_field_charlength= MAX_FIELD_VARCHARLENGTH; diff --git a/sql/field.h b/sql/field.h index 5e8f39d903e..e21994e3087 100644 --- a/sql/field.h +++ b/sql/field.h @@ -241,7 +241,7 @@ protected: }; - // String-to-number convertion methods for the old code compatibility + // String-to-number conversion methods for the old code compatibility longlong longlong_from_string_with_check(CHARSET_INFO *cs, const char *cptr, const char *end) const { @@ -312,7 +312,7 @@ public: /* Item context attributes. Comparison functions pass their attributes to propagate_equal_fields(). - For exmple, for string comparison, the collation of the comparison + For example, for string comparison, the collation of the comparison operation is important inside propagate_equal_fields(). */ class Context @@ -460,7 +460,7 @@ inline bool is_timestamp_type(enum_field_types type) /** - Convert temporal real types as retuned by field->real_type() + Convert temporal real types as returned by field->real_type() to field type as returned by field->type(). @param real_type Real type. @@ -3352,7 +3352,7 @@ private: This is the reason: - Field_bit::cmp_binary() is only implemented in the base class (Field::cmp_binary()). - - Field::cmp_binary() currenly use pack_length() to calculate how + - Field::cmp_binary() currently uses pack_length() to calculate how long the data is. - pack_length() includes size of the bits stored in the NULL bytes of the record. diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 8705e5e1e96..04e44db1c5c 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -236,7 +236,7 @@ static void do_skip(Copy_field *copy __attribute__((unused))) note: if the record we're copying from is NULL-complemetned (i.e. from_field->table->null_row==1), it will also have all NULLable columns to be - set to NULLs, so we dont need to check table->null_row here. + set to NULLs, so we don't need to check table->null_row here. */ static void do_copy_null(Copy_field *copy) diff --git a/sql/filesort.cc b/sql/filesort.cc index 90edd39b1da..81ddc77a46b 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -856,7 +856,7 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select, } if (!quick_select) { - (void) file->extra(HA_EXTRA_NO_CACHE); /* End cacheing of records */ + (void) file->extra(HA_EXTRA_NO_CACHE); /* End caching of records */ if (!next_pos) file->ha_rnd_end(); } @@ -864,7 +864,7 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select, if (thd->is_error()) DBUG_RETURN(HA_POS_ERROR); - /* Signal we should use orignal column read and write maps */ + /* Signal we should use original column read and write maps */ sort_form->column_bitmaps_set(save_read_set, save_write_set, save_vcol_set); DBUG_PRINT("test",("error: %d indexpos: %d",error,indexpos)); @@ -1141,7 +1141,7 @@ static void make_sortkey(Sort_param *param, } case ROW_RESULT: default: - // This case should never be choosen + // This case should never be chosen DBUG_ASSERT(0); break; } @@ -1927,7 +1927,7 @@ sortlength(THD *thd, SORT_FIELD *sortorder, uint s_length, break; case ROW_RESULT: default: - // This case should never be choosen + // This case should never be chosen DBUG_ASSERT(0); break; } diff --git a/sql/gcalc_slicescan.cc b/sql/gcalc_slicescan.cc index 179807326f9..cc38bb96491 100644 --- a/sql/gcalc_slicescan.cc +++ b/sql/gcalc_slicescan.cc @@ -1866,7 +1866,7 @@ int Gcalc_scan_iterator::add_eq_node(Gcalc_heap::Info *node, point *sp) if (!en) GCALC_DBUG_RETURN(1); - /* eq_node iserted after teh equal point. */ + /* eq_node inserted after the equal point. */ en->next= node->get_next(); node->next= en; diff --git a/sql/gcalc_slicescan.h b/sql/gcalc_slicescan.h index 7b7038812b2..1c0539e441f 100644 --- a/sql/gcalc_slicescan.h +++ b/sql/gcalc_slicescan.h @@ -355,9 +355,9 @@ enum Gcalc_scan_events /* - Gcalc_scan_iterator incapsulates the slisescan algorithm. - It takes filled Gcalc_heap as an datasource. Then can be - iterated trought the vertexes and intersection points with + Gcalc_scan_iterator incapsulates the slicescan algorithm. + It takes filled Gcalc_heap as a datasource. Then can be + iterated through the vertexes and intersection points with the step() method. After the 'step()' one usually observes the current 'slice' to do the necessary calculations, like looking for intersections, calculating the area, whatever. diff --git a/sql/gcalc_tools.cc b/sql/gcalc_tools.cc index acf51839e72..a8e380b691c 100644 --- a/sql/gcalc_tools.cc +++ b/sql/gcalc_tools.cc @@ -1173,14 +1173,14 @@ int Gcalc_operation_reducer::connect_threads( { rp0->outer_poly= prev_range->thread_start; tb->thread_start= prev_range->thread_start; - /* Chack if needed */ + /* Check if needed */ ta->thread_start= prev_range->thread_start; } else { rp0->outer_poly= 0; ta->thread_start= rp0; - /* Chack if needed */ + /* Check if needed */ tb->thread_start= rp0; } GCALC_DBUG_RETURN(0); diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 4169e2b30d8..82aad243c16 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -542,7 +542,7 @@ bool ha_partition::initialize_partition(MEM_ROOT *mem_root) point. If you do not implement this, the default delete_table() is called from - handler.cc and it will delete all files with the file extentions returned + handler.cc and it will delete all files with the file extensions returned by bas_ext(). Called from handler.cc by delete_table and ha_create_table(). Only used @@ -574,7 +574,7 @@ int ha_partition::delete_table(const char *name) Renames a table from one name to another from alter table call. If you do not implement this, the default rename_table() is called from - handler.cc and it will rename all files with the file extentions returned + handler.cc and it will rename all files with the file extensions returned by bas_ext(). Called from sql_table.cc by mysql_rename_table(). @@ -1428,7 +1428,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, /** - @brief Check and repair the table if neccesary + @brief Check and repair the table if necessary @param thd Thread object @@ -2907,7 +2907,7 @@ error_end: /** Read the .par file to get the partitions engines and names - @param name Name of table file (without extention) + @param name Name of table file (without extension) @return Operation status @retval true Failure @@ -3135,7 +3135,7 @@ static uchar *get_part_name(PART_NAME_DEF *part, size_t *length, @return Operation status @retval true Failure - @retval false Sucess + @retval false Success */ bool ha_partition::insert_partition_name_in_hash(const char *name, uint part_id, @@ -3261,7 +3261,7 @@ err: @return Operation status @retval true Failure - @retval false Sucess + @retval false Success */ bool ha_partition::set_ha_share_ref(Handler_share **ha_share_arg) @@ -4141,7 +4141,7 @@ int ha_partition::write_row(uchar * buf) /* If we have failed to set the auto-increment value for this row, it is highly likely that we will not be able to insert it into - the correct partition. We must check and fail if neccessary. + the correct partition. We must check and fail if necessary. */ if (error) goto exit; @@ -4211,7 +4211,7 @@ exit: have the previous row record in it, while new_data will have the newest data in it. Keep in mind that the server can do updates based on ordering if an - ORDER BY clause was used. Consecutive ordering is not guarenteed. + ORDER BY clause was used. Consecutive ordering is not guaranteed. Called from sql_select.cc, sql_acl.cc, sql_update.cc, and sql_insert.cc. new_data is always record[0] @@ -4353,7 +4353,7 @@ exit: (from either a previous rnd_xxx() or index_xxx() call). If you keep a pointer to the last row or can access a primary key it will make doing the deletion quite a bit easier. - Keep in mind that the server does no guarentee consecutive deletions. + Keep in mind that the server does no guarantee consecutive deletions. ORDER BY clauses can be used. Called in sql_acl.cc and sql_udf.cc to manage internal table information. @@ -4737,7 +4737,7 @@ int ha_partition::end_bulk_insert() When scan is used we will scan one handler partition at a time. When preparing for rnd_pos we will init all handler partitions. - No extra cache handling is needed when scannning is not performed. + No extra cache handling is needed when scanning is not performed. Before initialising we will call rnd_end to ensure that we clean up from any previous incarnation of a table scan. @@ -5833,7 +5833,7 @@ int ha_partition::read_range_next() SYNOPSIS ha_partition::partition_scan_set_up() buf Buffer to later return record in (this function - needs it to calculcate partitioning function + needs it to calculate partitioning function values) idx_read_flag TRUE <=> m_start_key has range start endpoint which @@ -6850,7 +6850,7 @@ void ha_partition::get_dynamic_partition_info(PARTITION_STATS *stat_info, function after completing a query. 3) It is called when deleting the QUICK_RANGE_SELECT object if the QUICK_RANGE_SELECT object had its own handler object. It is called - immediatley before close of this local handler object. + immediately before close of this local handler object. HA_EXTRA_KEYREAD: HA_EXTRA_NO_KEYREAD: These parameters are used to provide an optimisation hint to the handler. @@ -6887,7 +6887,7 @@ void ha_partition::get_dynamic_partition_info(PARTITION_STATS *stat_info, HA_EXTRA_IGNORE_DUP_KEY: HA_EXTRA_NO_IGNORE_DUP_KEY: Informs the handler to we will not stop the transaction if we get an - duplicate key errors during insert/upate. + duplicate key errors during insert/update. Always called in pair, triggered by INSERT IGNORE and other similar SQL constructs. Not used by MyISAM. @@ -8286,7 +8286,7 @@ bool ha_partition::prepare_inplace_alter_table(TABLE *altered_table, /* Changing to similar partitioning, only update metadata. - Non allowed changes would be catched in prep_alter_part_table(). + Non allowed changes would be caught in prep_alter_part_table(). */ if (ha_alter_info->alter_info->flags == Alter_info::ALTER_PARTITION) DBUG_RETURN(false); @@ -8319,7 +8319,7 @@ bool ha_partition::inplace_alter_table(TABLE *altered_table, /* Changing to similar partitioning, only update metadata. - Non allowed changes would be catched in prep_alter_part_table(). + Non allowed changes would be caught in prep_alter_part_table(). */ if (ha_alter_info->alter_info->flags == Alter_info::ALTER_PARTITION) DBUG_RETURN(false); @@ -8364,7 +8364,7 @@ bool ha_partition::commit_inplace_alter_table(TABLE *altered_table, /* Changing to similar partitioning, only update metadata. - Non allowed changes would be catched in prep_alter_part_table(). + Non allowed changes would be caught in prep_alter_part_table(). */ if (ha_alter_info->alter_info->flags == Alter_info::ALTER_PARTITION) DBUG_RETURN(false); diff --git a/sql/ha_partition.h b/sql/ha_partition.h index c2c4ffcda40..e3e4d068568 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -292,7 +292,7 @@ public: ------------------------------------------------------------------------- MODULE create/delete handler object ------------------------------------------------------------------------- - Object create/delete methode. The normal called when a table object + Object create/delete method. Normally called when a table object exists. There is also a method to create the handler object with only partition information. This is used from mysql_create_table when the table is to be created and the engine type is deduced to be the @@ -590,7 +590,7 @@ public: /** @breif - Positions an index cursor to the index specified in the hanlde. Fetches the + Positions an index cursor to the index specified in the handle. Fetches the row if available. If the key value is null, begin at first key of the index. */ @@ -805,7 +805,7 @@ public: HA_REC_NOT_IN_SEQ: This flag is set for handlers that cannot guarantee that the rows are - returned accroding to incremental positions (0, 1, 2, 3...). + returned according to incremental positions (0, 1, 2, 3...). This also means that rnd_next() should return HA_ERR_RECORD_DELETED if it finds a deleted row. (MyISAM (not fixed length row), HEAP, InnoDB) diff --git a/sql/handler.cc b/sql/handler.cc index 79f23c0d200..76a187f4312 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -725,7 +725,7 @@ int ha_end() /* - This should be eventualy based on the graceful shutdown flag. + This should be eventually based on the graceful shutdown flag. So if flag is equal to HA_PANIC_CLOSE, the deallocate the errors. */ @@ -1334,8 +1334,8 @@ int ha_commit_trans(THD *thd, bool all) THD_TRANS *trans= all ? &thd->transaction.all : &thd->transaction.stmt; /* "real" is a nick name for a transaction for which a commit will - make persistent changes. E.g. a 'stmt' transaction inside a 'all' - transation is not 'real': even though it's possible to commit it, + make persistent changes. E.g. a 'stmt' transaction inside an 'all' + transaction is not 'real': even though it's possible to commit it, the changes are not durable as they might be rolled back if the enclosing 'all' transaction is rolled back. */ @@ -2472,7 +2472,7 @@ handler *handler::clone(const char *name, MEM_ROOT *mem_root) /* TODO: Implement a more efficient way to have more than one index open for - the same table instance. The ha_open call is not cachable for clone. + the same table instance. The ha_open call is not cacheable for clone. This is not critical as the engines already have the table open and should be able to use the original instance of the table. @@ -3254,7 +3254,7 @@ int handler::update_auto_increment() index_init() or rnd_init() and in any column_bitmaps_signal() call after this. - The handler is allowd to do changes to the bitmap after a index_init or + The handler is allowed to do changes to the bitmap after a index_init or rnd_init() call is made as after this, MySQL will not use the bitmap for any program logic checking. */ @@ -3311,7 +3311,7 @@ void handler::get_auto_increment(ulonglong offset, ulonglong increment, { // Autoincrement at key-start error= ha_index_last(table->record[1]); /* - MySQL implicitely assumes such method does locking (as MySQL decides to + MySQL implicitly assumes such method does locking (as MySQL decides to use nr+increment without checking again with the handler, in handler::update_auto_increment()), so reserves to infinite. */ diff --git a/sql/handler.h b/sql/handler.h index 057a0e84125..c6cac5dfbbe 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -209,7 +209,7 @@ enum enum_alter_inplace_result { this flag must implement start_read_removal() and end_read_removal(). The handler may return "fake" rows constructed from the key of the row asked for. This is used to optimize UPDATE and DELETE by reducing the - numer of roundtrips between handler and storage engine. + number of roundtrips between handler and storage engine. Example: UPDATE a=1 WHERE pk IN () @@ -489,7 +489,7 @@ enum enum_binlog_command { /* Bits in used_fields */ #define HA_CREATE_USED_AUTO (1L << 0) -#define HA_CREATE_USED_RAID (1L << 1) //RAID is no longer availble +#define HA_CREATE_USED_RAID (1L << 1) //RAID is no longer available #define HA_CREATE_USED_UNION (1L << 2) #define HA_CREATE_USED_INSERT_METHOD (1L << 3) #define HA_CREATE_USED_MIN_ROWS (1L << 4) @@ -956,7 +956,7 @@ struct handler_iterator { /* Pointer to buffer for the iterator to use. Should be allocated by function which created the iterator and - destroied by freed by above "destroy" call + destroyed by freed by above "destroy" call */ void *buffer; }; @@ -1172,7 +1172,7 @@ struct handlerton "cookie". The flush and call of commit_checkpoint_notify_ha() need not happen - immediately - it can be scheduled and performed asynchroneously (ie. as + immediately - it can be scheduled and performed asynchronously (ie. as part of next prepare(), or sync every second, or whatever), but should not be postponed indefinitely. It is however also permissible to do it immediately, before returning from commit_checkpoint_request(). @@ -1258,13 +1258,13 @@ struct handlerton Used by open_table_error(), by the default rename_table and delete_table handler methods, and by the default discovery implementation. - For engines that have more than one file name extentions (separate + For engines that have more than one file name extensions (separate metadata, index, and/or data files), the order of elements is relevant. - First element of engine file name extentions array should be metadata - file extention. This is implied by the open_table_error() + First element of engine file name extensions array should be metadata + file extension. This is implied by the open_table_error() and the default discovery implementation. - Second element - data file extention. This is implied + Second element - data file extension. This is implied assumed by REPAIR TABLE ... USE_FRM implementation. */ const char **tablefile_extensions; // by default - empty list @@ -1760,7 +1760,7 @@ struct HA_CREATE_INFO: public Table_scope_and_contents_source_st, CONVERT TO CHARACTER SET DEFAULT to CONVERT TO CHARACTER SET - TODO: Should't we postpone resolution of DEFAULT until the + TODO: Shouldn't we postpone resolution of DEFAULT until the character set of the table owner database is loaded from its db.opt? */ DBUG_ASSERT(cs); @@ -2619,7 +2619,7 @@ public: ha_statistics stats; /** MultiRangeRead-related members: */ - range_seq_t mrr_iter; /* Interator to traverse the range sequence */ + range_seq_t mrr_iter; /* Iterator to traverse the range sequence */ RANGE_SEQ_IF mrr_funcs; /* Range sequence traversal functions */ HANDLER_BUFFER *multi_range_buffer; /* MRR buffer info */ uint ranges_in_seq; /* Total number of ranges in the traversed sequence */ @@ -3440,7 +3440,7 @@ public: This method offers the storage engine, the possibility to store a reference to a table name which is going to be used with query cache. The method is called each time a statement is written to the cache and can - be used to verify if a specific statement is cachable. It also offers + be used to verify if a specific statement is cacheable. It also offers the possibility to register a generic (but static) call back function which is called each time a statement is matched against the query cache. diff --git a/sql/item.cc b/sql/item.cc index a05fafae3b2..2e12b8d8b64 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1342,7 +1342,7 @@ err: bool Item::make_zero_date(MYSQL_TIME *ltime, ulonglong fuzzydate) { /* - if the item was not null and convertion failed, we return a zero date + if the item was not null and conversion failed, we return a zero date if allowed, otherwise - null. */ bzero((char*) ltime,sizeof(*ltime)); @@ -4247,7 +4247,7 @@ static bool mark_as_dependent(THD *thd, SELECT_LEX *last, SELECT_LEX *current, @note We have to mark all items between current_sel (including) and - last_select (excluding) as dependend (select before last_select should + last_select (excluding) as dependent (select before last_select should be marked with actual table mask used by resolved item, all other with OUTER_REF_TABLE_BIT) and also write dependence information to Item of resolved identifier. @@ -4620,7 +4620,7 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference) bool upward_lookup= FALSE; TABLE_LIST *table_list; - /* Calulate the TABLE_LIST for the table */ + /* Calculate the TABLE_LIST for the table */ table_list= (cached_table ? cached_table : field_found && (*from_field) != view_ref_found ? (*from_field)->table->pos_in_table_list : 0); @@ -5334,7 +5334,7 @@ Item *Item_field::propagate_equal_fields(THD *thd, but failed to create a valid DATE literal from the given string literal. Do not do constant propagation in such cases and unlink - "this" from the found Item_equal (as this equality not usefull). + "this" from the found Item_equal (as this equality not useful). */ item_equal= NULL; return this; @@ -6934,7 +6934,7 @@ bool Item_ref::fix_fields(THD *thd, Item **reference) /* Due to cache, find_field_in_tables() can return field which doesn't belong to provided outer_context. In this case we have - to find proper field context in order to fix field correcly. + to find proper field context in order to fix field correctly. */ do { @@ -7118,9 +7118,9 @@ Item* Item_ref::transform(THD *thd, Item_transformer transformer, uchar *arg) callback functions. First the function applies the analyzer to the Item_ref object. Then - if the analizer succeeeds we first applies the compile method to the + if the analyzer succeeds we first apply the compile method to the object the Item_ref object is referencing. If this returns a new - item the old item is substituted for a new one. After this the + item the old item is substituted for a new one. After this the transformer is applied to the Item_ref object itself. The compile function is not called if the analyzer returns NULL in the parameter arg_p. @@ -9578,7 +9578,7 @@ bool Item_type_holder::join_types(THD *thd, Item *item) } /** - Calculate lenth for merging result for given Item type. + Calculate length for merging result for given Item type. @param item Item for length detection diff --git a/sql/item.h b/sql/item.h index bf1087e7e6e..1bf7ad5b87e 100644 --- a/sql/item.h +++ b/sql/item.h @@ -204,7 +204,7 @@ void dummy_error_processor(THD *thd, void *data); void view_error_processor(THD *thd, void *data); /* - Instances of Name_resolution_context store the information necesary for + Instances of Name_resolution_context store the information necessary for name resolution of Items and other context analysis of a query made in fix_fields(). @@ -362,7 +362,7 @@ public: Monotonicity is defined only for Item* trees that represent table partitioning expressions (i.e. have no subselects/user vars/PS parameters etc etc). An Item* tree is assumed to have the same monotonicity properties - as its correspoinding function F: + as its corresponding function F: [signed] longlong F(field1, field2, ...) { put values of field_i into table record buffer; @@ -701,7 +701,7 @@ protected: return rc; } /* - This method is used if the item was not null but convertion to + This method is used if the item was not null but conversion to TIME/DATE/DATETIME failed. We return a zero date if allowed, otherwise - null. */ @@ -822,7 +822,7 @@ public: /* real_type() is the type of base item. This is same as type() for most items, except Item_ref() and Item_cache_wrapper() where it - shows the type for the underlaying item. + shows the type for the underlying item. */ virtual enum Type real_type() const { return type(); } @@ -915,7 +915,7 @@ public: The caller can modify the returned String, if it's not marked "const" (with the String::mark_as_const() method). That means that if the item returns its own internal buffer (e.g. tmp_value), it - *must* be marked "const" [1]. So normally it's preferrable to + *must* be marked "const" [1]. So normally it's preferable to return the result value in the String, that was passed as an argument. But, for example, SUBSTR() returns a String that simply points into the buffer of SUBSTR()'s args[0]->val_str(). Such a @@ -1239,7 +1239,7 @@ public: @param cond_ptr[OUT] Store a replacement item here if the condition can be simplified, e.g.: WHERE part1 OR part2 OR part3 - with one of the partN evalutating to SEL_TREE::ALWAYS. + with one of the partN evaluating to SEL_TREE::ALWAYS. */ virtual SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr); /* @@ -1833,7 +1833,7 @@ public: virtual bool is_outer_field() const { DBUG_ASSERT(fixed); return FALSE; } /** - Checks if this item or any of its decendents contains a subquery. + Checks if this item or any of its descendents contains a subquery. */ virtual bool has_subquery() const { return with_subselect; } @@ -4692,7 +4692,7 @@ public: This is the method that updates the cached value. It must be explicitly called by the user of this class to store the value - of the orginal item in the cache. + of the original item in the cache. */ virtual void copy() = 0; diff --git a/sql/item_buff.cc b/sql/item_buff.cc index 22e0680336f..9cf974a2c21 100644 --- a/sql/item_buff.cc +++ b/sql/item_buff.cc @@ -140,7 +140,7 @@ bool Cached_item_field::cmp(void) /* If value is not null and value changed (from null to not null or - becasue of value change), then copy the new value to buffer. + because of value change), then copy the new value to buffer. */ if (! null_value && (tmp || (tmp= (field->cmp(buff) != 0)))) field->get_image(buff,length,field->charset()); diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 2e029f307fc..61c6b980551 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -745,7 +745,7 @@ Item** Arg_comparator::cache_converted_constant(THD *thd_arg, Item **value, If the value should be compared as time (TIME_RESULT), it's retrieved as MYSQL_TIME. Otherwise it's read as a number/string and converted to time. - Constant items are cached, so the convertion is only done once for them. + Constant items are cached, so the conversion is only done once for them. Note the f_type behavior: if the item can be compared as time, then f_type is this item's field_type(). Otherwise it's field_type() of @@ -1425,7 +1425,7 @@ bool Item_in_optimizer::fix_fields(THD *thd, Item **ref) @note Item_in_optimizer should work as pass-through for - subqueries that were processed by ALL/ANY->MIN/MAX rewrite - - subqueries taht were originally EXISTS subqueries (and were coverted by + - subqueries that were originally EXISTS subqueries (and were coinverted by the EXISTS->IN rewrite) When Item_in_optimizer is not not working as a pass-through, it @@ -2013,8 +2013,8 @@ longlong Item_func_interval::val_int() interval_range *range= intervals + mid; my_bool cmp_result; /* - The values in the range intervall may have different types, - Only do a decimal comparision of the first argument is a decimal + The values in the range interval may have different types, + Only do a decimal comparison if the first argument is a decimal and we are comparing against a decimal */ if (dec && range->type == DECIMAL_RESULT) @@ -2696,7 +2696,7 @@ Item_func_nullif::fix_length_and_dec() Some examples of what NULLIF can end up with after argument substitution (we don't mention args[1] in some cases for simplicity): - 1. l_expr is not an aggragate function: + 1. l_expr is not an aggregate function: a. No conversion happened. args[0] and args[2] were not replaced to something else @@ -2817,7 +2817,7 @@ Item_func_nullif::fix_length_and_dec() In this case we remember and reuse m_arg0 during EXECUTE time as args[2]. QQ: How to make sure that m_args0 does not point - to something temporary which will be destoyed between PREPARE and EXECUTE. + to something temporary which will be destroyed between PREPARE and EXECUTE. The condition below should probably be more strict and somehow check that: - change_item_tree() was called for the new args[0] - m_args0 is referenced from inside args[0], e.g. as a function argument, @@ -3279,7 +3279,7 @@ void Item_func_case::fix_length_and_dec() If we'll do string comparison, we also need to aggregate character set and collation for first/WHEN items and install converters for some of them to cmp_collation when necessary. - This is done because cmp_item compatators cannot compare + This is done because cmp_item comparators cannot compare strings in two different character sets. Some examples when we install converters: @@ -4402,7 +4402,7 @@ void Item_func_in::fix_length_and_dec() else { /* - We don't put NULL values in array, to avoid erronous matches in + We don't put NULL values in array, to avoid erroneous matches in bisection. */ have_null= 1; @@ -6887,7 +6887,7 @@ Item* Item_equal::get_first(JOIN_TAB *context, Item *field_item) and not ot2.col. eliminate_item_equal() also has code that deals with equality substitution - in presense of SJM nests. + in presence of SJM nests. */ TABLE_LIST *emb_nest; diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index e47b88bdcbb..0ea7fd9d2b0 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -150,7 +150,7 @@ protected: /* Return the full select tree for "field_item" and "value": - a single SEL_TREE if the field is not in a multiple equality, or - - a conjuction of all SEL_TREEs for all fields from + - a conjunction of all SEL_TREEs for all fields from the same multiple equality with "field_item". */ SEL_TREE *get_full_func_mm_tree(RANGE_OPT_PARAM *param, diff --git a/sql/item_func.cc b/sql/item_func.cc index 5e605855d80..b4cffc84b80 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -363,7 +363,7 @@ Item *Item_func::transform(THD *thd, Item_transformer transformer, uchar *argume callback functions. First the function applies the analyzer to the root node of - the Item_func object. Then if the analizer succeeeds (returns TRUE) + the Item_func object. Then if the analyzer succeeds (returns TRUE) the function recursively applies the compile method to each argument of the Item_func node. If the call of the method for an argument item returns a new item @@ -1788,7 +1788,7 @@ void Item_func_div::fix_length_and_dec() case TIME_RESULT: DBUG_ASSERT(0); } - maybe_null= 1; // devision by zero + maybe_null= 1; // division by zero DBUG_VOID_RETURN; } @@ -1862,7 +1862,7 @@ longlong Item_func_int_div::val_int() void Item_func_int_div::fix_length_and_dec() { Item_result argtype= args[0]->result_type(); - /* use precision ony for the data type it is applicable for and valid */ + /* use precision only for the data type it is applicable for and valid */ uint32 char_length= args[0]->max_char_length() - (argtype == DECIMAL_RESULT || argtype == INT_RESULT ? args[0]->decimals : 0); @@ -4816,7 +4816,7 @@ bool Item_func_set_user_var::register_field_in_bitmap(uchar *arg) @param type type of new value @param cs charset info for new value @param dv derivation for new value - @param unsigned_arg indiates if a value of type INT_RESULT is unsigned + @param unsigned_arg indicates if a value of type INT_RESULT is unsigned @note Sets error and fatal error if allocation fails. @@ -4894,7 +4894,7 @@ Item_func_set_user_var::update_hash(void *ptr, uint length, bool unsigned_arg) { /* - If we set a variable explicitely to NULL then keep the old + If we set a variable explicitly to NULL then keep the old result type of the variable */ if ((null_value= args[0]->null_value) && null_item) @@ -6534,7 +6534,7 @@ void my_missing_function_error(const LEX_STRING &token, const char *func_name) @brief Initialize the result field by creating a temporary dummy table and assign it to a newly created field object. Meta data used to create the field is fetched from the sp_head belonging to the stored - proceedure found in the stored procedure functon cache. + procedure found in the stored procedure function cache. @note This function should be called from fix_fields to init the result field. It is some what related to Item_field. @@ -6838,7 +6838,7 @@ Item_func_sp::fix_fields(THD *thd, Item **ref) /* Here we check privileges of the stored routine only during view creation, in order to validate the view. A runtime check is - perfomed in Item_func_sp::execute(), and this method is not + performed in Item_func_sp::execute(), and this method is not called during context analysis. Notice, that during view creation we do not infer into stored routine bodies and do not check privileges of its statements, which would probably be a diff --git a/sql/item_inetfunc.cc b/sql/item_inetfunc.cc index 4cf43e075a5..061811b0799 100644 --- a/sql/item_inetfunc.cc +++ b/sql/item_inetfunc.cc @@ -206,7 +206,7 @@ String *Item_func_inet_str_base::val_str_ascii(String *buffer) @return Completion status. @retval false Given string does not represent an IPv4-address. - @retval true The string has been converted sucessfully. + @retval true The string has been converted successfully. @note The problem with inet_pton() is that it treats leading zeros in IPv4-part differently on different platforms. @@ -331,7 +331,7 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address) @return Completion status. @retval false Given string does not represent an IPv6-address. - @retval true The string has been converted sucessfully. + @retval true The string has been converted successfully. @note The problem with inet_pton() is that it treats leading zeros in IPv4-part differently on different platforms. @@ -677,7 +677,7 @@ static void ipv6_to_str(const in6_addr *ipv6, char *str) @return Completion status. @retval false Given string does not represent an IP-address. - @retval true The string has been converted sucessfully. + @retval true The string has been converted successfully. */ bool Item_func_inet6_aton::calc_value(const String *arg, String *buffer) @@ -717,7 +717,7 @@ bool Item_func_inet6_aton::calc_value(const String *arg, String *buffer) @return Completion status. @retval false The argument does not correspond to IP-address. - @retval true The string has been converted sucessfully. + @retval true The string has been converted successfully. */ bool Item_func_inet6_ntoa::calc_value(const String *arg, String *buffer) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index f3e19a19b3c..640242bbcff 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -923,7 +923,7 @@ String *Item_func_concat_ws::val_str(String *str) goto null; // Must be a blob } else if (res2 == &tmp_value) - { // This can happend only 1 time + { // This can happen only 1 time if (tmp_value.replace(0,0,*sep_str) || tmp_value.replace(0,0,*res)) goto null; res= &tmp_value; @@ -1071,7 +1071,7 @@ void Item_func_reverse::fix_length_and_dec() } /** - Replace all occurences of string2 in string1 with string3. + Replace all occurrences of string2 in string1 with string3. Don't reallocate val_str() if not needed. @@ -3839,7 +3839,7 @@ void Item_func_export_set::fix_length_and_dec() using in a SQL statement. Adds a \\ before all characters that needs to be escaped in a SQL string. - We also escape '^Z' (END-OF-FILE in windows) to avoid probelms when + We also escape '^Z' (END-OF-FILE in windows) to avoid problems when running commands from a file in windows. This function is very useful when you want to generate SQL statements. diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index ebe8e23add5..b5f3cd052e2 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -1096,12 +1096,12 @@ void Item_singlerow_subselect::reset() /** @todo - - We cant change name of Item_field or Item_ref, because it will - prevent it's correct resolving, but we should save name of + - We can't change name of Item_field or Item_ref, because it will + prevent its correct resolving, but we should save name of removed item => we do not make optimization if top item of list is field or reference. - switch off this optimization for prepare statement, - because we do not rollback this changes. + because we do not rollback these changes. Make rollback for it, or special name resolving mode in 5.0. @param join Join object of the subquery (i.e. 'child' join). @@ -1124,8 +1124,8 @@ Item_singlerow_subselect::select_transformer(JOIN *join) select_lex->item_list.elements == 1 && !select_lex->item_list.head()->with_sum_func && /* - We cant change name of Item_field or Item_ref, because it will - prevent it's correct resolving, but we should save name of + We can't change name of Item_field or Item_ref, because it will + prevent its correct resolving, but we should save name of removed item => we do not make optimization if top item of list is field or reference. TODO: solve above problem @@ -1610,7 +1610,7 @@ longlong Item_exists_subselect::val_int() Return the result of EXISTS as a string value Converts the true/false result into a string value. - Note that currently this cannot be NULL, so if the query exection fails + Note that currently this cannot be NULL, so if the query execution fails it will return 0. @param decimal_value[out] buffer to hold the resulting string value @@ -1633,7 +1633,7 @@ String *Item_exists_subselect::val_str(String *str) Return the result of EXISTS as a decimal value Converts the true/false result into a decimal value. - Note that currently this cannot be NULL, so if the query exection fails + Note that currently this cannot be NULL, so if the query execution fails it will return 0. @param decimal_value[out] Buffer to hold the resulting decimal value @@ -2280,7 +2280,7 @@ Item_in_subselect::row_value_transformer(JOIN *join) /* The uncacheable property controls a number of actions, e.g. whether to save/restore (via init_save_join_tab/restore_tmp) the original JOIN for - plans with a temp table where the original JOIN was overriden by + plans with a temp table where the original JOIN was overridden by make_simple_join. The UNCACHEABLE_EXPLAIN is ignored by EXPLAIN, thus non-correlated subqueries will not appear as such to EXPLAIN. */ @@ -2327,7 +2327,7 @@ Item_in_subselect::row_value_transformer(JOIN *join) is_not_null_test(v3)) where is_not_null_test registers NULLs values but reject rows. - in case when we do not need correct NULL, we have simplier construction: + in case when we do not need correct NULL, we have simpler construction: EXISTS (SELECT ... WHERE where and (l1 = v1) and (l2 = v2) and @@ -2580,7 +2580,7 @@ bool Item_in_subselect::create_in_to_exists_cond(JOIN *join_arg) /* The uncacheable property controls a number of actions, e.g. whether to save/restore (via init_save_join_tab/restore_tmp) the original JOIN for - plans with a temp table where the original JOIN was overriden by + plans with a temp table where the original JOIN was overridden by make_simple_join. The UNCACHEABLE_EXPLAIN is ignored by EXPLAIN, thus non-correlated subqueries will not appear as such to EXPLAIN. */ @@ -3178,7 +3178,7 @@ Item_in_subselect::select_in_like_transformer(JOIN *join) /* In some optimisation cases we will not need this Item_in_optimizer object, but we can't know it here, but here we need address correct - reference on left expresion. + reference on left expression. note: we won't need Item_in_optimizer when handling degenerate cases like "... IN (SELECT 1)" @@ -3210,7 +3210,7 @@ Item_in_subselect::select_in_like_transformer(JOIN *join) and all that items do not make permanent changes in current item arena which allow to us call them with changed arena (if we do not know nature of Item, we have to call fix_fields() for it only with original arena to - avoid memory leack) + avoid memory leak) */ if (left_expr->cols() == 1) trans_res= single_value_transformer(join); @@ -3373,7 +3373,7 @@ bool Item_in_subselect::setup_mat_engine() /* The select_engine (that executes transformed IN=>EXISTS subselects) is - pre-created at parse time, and is stored in statment memory (preserved + pre-created at parse time, and is stored in statement memory (preserved across PS executions). */ DBUG_ASSERT(engine->engine_type() == subselect_engine::SINGLE_SELECT_ENGINE); @@ -3833,7 +3833,7 @@ int subselect_single_select_engine::exec() For at least one of the pushed predicates the following is true: We should not apply optimizations based on the condition that was pushed down into the subquery. Those optimizations are ref[_or_null] - acceses. Change them to be full table scans. + accesses. Change them to be full table scans. */ JOIN_TAB *tab; for (tab= first_linear_tab(join, WITH_BUSH_ROOTS, WITHOUT_CONST_TABLES); @@ -4742,7 +4742,7 @@ subselect_hash_sj_engine::choose_partial_match_strategy( /* Choose according to global optimizer switch. If only one of the switches is 'ON', then the remaining strategy is the only possible one. The only cases - when this will be overriden is when the total size of all buffers for the + when this will be overridden is when the total size of all buffers for the merge strategy is bigger than the 'rowid_merge_buff_size' system variable, or if there isn't enough physical memory to allocate the buffers. */ @@ -6061,7 +6061,7 @@ int subselect_partial_match_engine::exec() if (has_covering_null_row) { /* - If there is a NULL-only row that coveres all columns the result of IN + If there is a NULL-only row that covers all columns the result of IN is UNKNOWN. */ item_in->value= 0; @@ -6261,7 +6261,7 @@ subselect_rowid_merge_engine::init(MY_BITMAP *non_null_key_parts, for (uint i= (non_null_key ? 1 : 0); i < merge_keys_count; i++) { /* - Check if the first and only indexed column contains NULL in the curent + Check if the first and only indexed column contains NULL in the current row, and add the row number to the corresponding key. */ if (tmp_table->field[merge_keys[i]->get_field_idx(0)]->is_null()) @@ -6472,7 +6472,7 @@ bool subselect_rowid_merge_engine::partial_match() } /* - If all nullable columns contain only NULLs, then there is a guranteed + If all nullable columns contain only NULLs, then there is a guaranteed partial match, and we don't need to search for a matching row. */ if (has_covering_null_columns) diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 3be1013e4e3..ee8b31f4f17 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -541,7 +541,7 @@ public: bool jtbm_const_row_found; /* - TRUE<=>this is a flattenable semi-join, false overwise. + TRUE<=>this is a flattenable semi-join, false otherwise. */ bool is_flattenable_semijoin; @@ -964,7 +964,7 @@ class subselect_indexsubquery_engine: public subselect_uniquesubquery_engine /* FALSE for 'ref', TRUE for 'ref-or-null'. */ bool check_null; /* - The "having" clause. This clause (further reffered to as "artificial + The "having" clause. This clause (further referred to as "artificial having") was inserted by subquery transformation code. It contains Item(s) that have a side-effect: they record whether the subquery has produced a row with NULL certain components. We need to use it for cases @@ -985,7 +985,7 @@ class subselect_indexsubquery_engine: public subselect_uniquesubquery_engine However, subqueries like the above are currently not handled by index lookup-based subquery engines, the engine applicability check misses them: it doesn't switch the engine for case of artificial having and - [eq_]ref access (only for artifical having + ref_or_null or no having). + [eq_]ref access (only for artificial having + ref_or_null or no having). The above example subquery is handled as a full-blown SELECT with eq_ref access to one table. @@ -1056,7 +1056,7 @@ public: */ JOIN *materialize_join; /* - A conjunction of all the equality condtions between all pairs of expressions + A conjunction of all the equality conditions between all pairs of expressions that are arguments of an IN predicate. We need these to post-filter some IN results because index lookups sometimes match values that are actually not equal to the search key in SQL terms. diff --git a/sql/item_sum.cc b/sql/item_sum.cc index f5bcd082824..36bb39f14d8 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -527,7 +527,7 @@ Field *Item_sum::create_tmp_field(bool group, TABLE *table) break; case ROW_RESULT: case TIME_RESULT: - // This case should never be choosen + // This case should never be chosen DBUG_ASSERT(0); return 0; } @@ -717,7 +717,7 @@ calc_tmp_field_type(enum enum_field_types table_field_type, C_MODE_START -/* Declarations for auxilary C-callbacks */ +/* Declarations for auxiliary C-callbacks */ int simple_raw_key_cmp(void* arg, const void* key1, const void* key2) { @@ -749,7 +749,7 @@ C_MODE_END @param thd Thread descriptor @return status @retval FALSE success - @retval TRUE faliure + @retval TRUE failure Prepares Aggregator_distinct to process the incoming stream. Creates the temporary table and the Unique class if needed. @@ -1215,7 +1215,7 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref) DBUG_ASSERT(0); }; setup_hybrid(thd, args[0], NULL); - /* MIN/MAX can return NULL for empty set indepedent of the used column */ + /* MIN/MAX can return NULL for empty set independent of the used column */ maybe_null= 1; result_field=0; null_value=1; @@ -1630,7 +1630,7 @@ void Item_sum_count::cleanup() /* - Avgerage + Average */ void Item_sum_avg::fix_length_and_dec() { @@ -1863,7 +1863,7 @@ void Item_sum_variance::fix_length_and_dec() /* According to the SQL2003 standard (Part 2, Foundations; sec 10.9, aggregate function; paragraph 7h of Syntax Rules), "the declared - type of the result is an implementation-defined aproximate numeric + type of the result is an implementation-defined approximate numeric type. */ @@ -1953,7 +1953,7 @@ double Item_sum_variance::val_real() is one or zero. If it's zero, i.e. a population variance, then we only set nullness when the count is zero. - Another way to read it is that 'sample' is the numerical threshhold, at and + Another way to read it is that 'sample' is the numerical threshold, at and below which a 'count' number of items is called NULL. */ DBUG_ASSERT((sample == 0) || (sample == 1)); @@ -3567,7 +3567,7 @@ bool Item_func_group_concat::setup(THD *thd) { /* Force the create_tmp_table() to convert BIT columns to INT - as we cannot compare two table records containg BIT fields + as we cannot compare two table records containing BIT fields stored in the the tree used for distinct/order by. Moreover we don't even save in the tree record null bits where BIT fields store parts of their data. diff --git a/sql/item_sum.h b/sql/item_sum.h index cbca701e5b0..6bfa7a39486 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -250,7 +250,7 @@ class st_select_lex; The field 'aggr_level' is to contain the nest level of the subquery where the set function is aggregated. - The field 'max_arg_level' is for the maximun of the nest levels of the + The field 'max_arg_level' is for the maximum of the nest levels of the unbound column references occurred in the set function. A column reference is unbound within a set function if it is not bound by any subquery used as a subexpression in this function. A column reference is bound by diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 93889f75f83..de973832402 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -452,7 +452,7 @@ err: /** - Create a formated date/time value in a string. + Create a formatted date/time value in a string. */ static bool make_date_time(const LEX_CSTRING &format, MYSQL_TIME *l_time, @@ -1028,7 +1028,7 @@ uint week_mode(uint mode) a date at start of january) In this case one can get 53 for the first week of next year. This flag ensures that the week is relevant for the given year. Note that this flag is only - releveant if WEEK_JANUARY is not set. + relevant if WEEK_JANUARY is not set. If set Week is in range 1-53. @@ -1337,7 +1337,7 @@ bool get_interval_value(Item *args,interval_type int_type, INTERVAL *interval) if (!(res= args->val_str_ascii(&str_value))) return (1); - /* record negative intervalls in interval->neg */ + /* record negative intervals in interval->neg */ str=res->ptr(); cs= res->charset(); const char *end=str+res->length(); @@ -1599,7 +1599,7 @@ void Item_func_curdate::fix_length_and_dec() } /** - Converts current time in my_time_t to MYSQL_TIME represenatation for local + Converts current time in my_time_t to MYSQL_TIME representation for local time zone. Defines time zone (local) used for whole CURDATE function. */ void Item_func_curdate_local::store_now_in_TIME(MYSQL_TIME *now_time) @@ -1611,7 +1611,7 @@ void Item_func_curdate_local::store_now_in_TIME(MYSQL_TIME *now_time) /** - Converts current time in my_time_t to MYSQL_TIME represenatation for UTC + Converts current time in my_time_t to MYSQL_TIME representation for UTC time zone. Defines time zone (UTC) used for whole UTC_DATE function. */ void Item_func_curdate_utc::store_now_in_TIME(MYSQL_TIME *now_time) @@ -1664,7 +1664,7 @@ static void set_sec_part(ulong sec_part, MYSQL_TIME *ltime, Item *item) } /** - Converts current time in my_time_t to MYSQL_TIME represenatation for local + Converts current time in my_time_t to MYSQL_TIME representation for local time zone. Defines time zone (local) used for whole CURTIME function. */ void Item_func_curtime_local::store_now_in_TIME(MYSQL_TIME *now_time) @@ -1679,7 +1679,7 @@ void Item_func_curtime_local::store_now_in_TIME(MYSQL_TIME *now_time) /** - Converts current time in my_time_t to MYSQL_TIME represenatation for UTC + Converts current time in my_time_t to MYSQL_TIME representation for UTC time zone. Defines time zone (UTC) used for whole UTC_TIME function. */ void Item_func_curtime_utc::store_now_in_TIME(MYSQL_TIME *now_time) @@ -1707,7 +1707,7 @@ bool Item_func_now::fix_fields(THD *thd, Item **items) } /** - Converts current time in my_time_t to MYSQL_TIME represenatation for local + Converts current time in my_time_t to MYSQL_TIME representation for local time zone. Defines time zone (local) used for whole NOW function. */ void Item_func_now_local::store_now_in_TIME(MYSQL_TIME *now_time) @@ -1720,7 +1720,7 @@ void Item_func_now_local::store_now_in_TIME(MYSQL_TIME *now_time) /** - Converts current time in my_time_t to MYSQL_TIME represenatation for UTC + Converts current time in my_time_t to MYSQL_TIME representation for UTC time zone. Defines time zone (UTC) used for whole UTC_TIMESTAMP function. */ void Item_func_now_utc::store_now_in_TIME(MYSQL_TIME *now_time) @@ -1744,7 +1744,7 @@ bool Item_func_now::get_date(MYSQL_TIME *res, /** - Converts current time in my_time_t to MYSQL_TIME represenatation for local + Converts current time in my_time_t to MYSQL_TIME representation for local time zone. Defines time zone (local) used for whole SYSDATE function. */ void Item_func_sysdate_local::store_now_in_TIME(MYSQL_TIME *now_time) @@ -2055,7 +2055,7 @@ bool Item_func_convert_tz::get_date(MYSQL_TIME *ltime, uint not_used; my_time_tmp= from_tz->TIME_to_gmt_sec(ltime, ¬_used); ulong sec_part= ltime->second_part; - /* my_time_tmp is guranteed to be in the allowed range */ + /* my_time_tmp is guaranteed to be in the allowed range */ if (my_time_tmp) to_tz->gmt_sec_to_TIME(ltime, my_time_tmp); /* we rely on the fact that no timezone conversion can change sec_part */ @@ -2497,7 +2497,7 @@ void Item_char_typecast::fix_length_and_dec() uint32 char_length; /* We always force character set conversion if cast_cs - is a multi-byte character set. It garantees that the + is a multi-byte character set. It guarantees that the result of CAST is a well-formed string. For single-byte character sets we allow just to copy from the argument. A single-byte character sets string diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc index 97ef24b0851..caa0415bcac 100644 --- a/sql/item_xmlfunc.cc +++ b/sql/item_xmlfunc.cc @@ -68,7 +68,7 @@ typedef struct my_xml_node_st } MY_XML_NODE; -/* Lexical analizer token */ +/* Lexical analyzer token */ typedef struct my_xpath_lex_st { int term; /* token type, see MY_XPATH_LEX_XXXXX below */ @@ -1078,7 +1078,7 @@ static Item* nametestfunc(MY_XPATH *xpath, /* - Tokens consisting of one character, for faster lexical analizer. + Tokens consisting of one character, for faster lexical analyzer. */ static char simpletok[128]= { @@ -1398,7 +1398,7 @@ my_xpath_function(const char *beg, const char *end) } -/* Initialize a lex analizer token */ +/* Initialize a lex analyzer token */ static void my_xpath_lex_init(MY_XPATH_LEX *lex, const char *str, const char *strend) @@ -1429,7 +1429,7 @@ my_xdigit(int c) SYNOPSYS Scan the next token from the input. lex->term is set to the scanned token type. - lex->beg and lex->end are set to the beginnig + lex->beg and lex->end are set to the beginning and to the end of the token. RETURN N/A @@ -1455,7 +1455,7 @@ my_xpath_lex_scan(MY_XPATH *xpath, (const uchar*) end)) > 0 && ((ctype & (_MY_L | _MY_U)) || *beg == '_')) { - // scan untill the end of the idenfitier + // scan until the end of the identifier for (beg+= length; (length= xpath->cs->cset->ctype(xpath->cs, &ctype, (const uchar*) beg, @@ -1584,7 +1584,7 @@ static int my_xpath_parse_AxisName(MY_XPATH *xpath) ** Grammar rules, according to http://www.w3.org/TR/xpath ** Implemented using recursive descendant method. ** All the following grammar processing functions accept -** a signle "xpath" argument and return 1 on success and 0 on error. +** a single "xpath" argument and return 1 on success and 0 on error. ** They also modify "xpath" argument by creating new items. */ @@ -2464,7 +2464,7 @@ static int my_xpath_parse_UnaryExpr(MY_XPATH *xpath) as it is in conflict with abbreviated step. 1 + .123 does not work, 1 + 0.123 does. - Perhaps it is better to move this code into lex analizer. + Perhaps it is better to move this code into lex analyzer. RETURN 1 - success @@ -2809,7 +2809,7 @@ append_node(String *str, MY_XML_NODE *node) SYNOPSYS A call-back function executed when XML parser - is entering a tag or an attribue. + is entering a tag or an attribute. Appends the new node into data->pxml. Increments data->level. @@ -2845,7 +2845,7 @@ int xml_enter(MY_XML_PARSER *st,const char *attr, size_t len) SYNOPSYS A call-back function executed when XML parser - is entering into a tag or an attribue textual value. + is entering into a tag or an attribute textual value. The value is appended into data->pxml. RETURN @@ -2873,7 +2873,7 @@ int xml_value(MY_XML_PARSER *st,const char *attr, size_t len) SYNOPSYS A call-back function executed when XML parser - is leaving a tag or an attribue. + is leaving a tag or an attribute. Decrements data->level. RETURN diff --git a/sql/key.cc b/sql/key.cc index 9c59bdf020a..013733db62a 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -230,7 +230,7 @@ void key_restore(uchar *to_record, uchar *from_key, KEY *key_info, { /* This in fact never happens, as we have only partial BLOB - keys yet anyway, so it's difficult to find any sence to + keys yet anyway, so it's difficult to find any sense to restore the part of a record. Maybe this branch is to be removed, but now we have to ignore GCov compaining. diff --git a/sql/lex.h b/sql/lex.h index 3386dbf3de6..e54c0260090 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -23,7 +23,7 @@ #include "lex_symbol.h" SYM_GROUP sym_group_common= {"", ""}; -SYM_GROUP sym_group_geom= {"Spatial extentions", "HAVE_SPATIAL"}; +SYM_GROUP sym_group_geom= {"Spatial extensions", "HAVE_SPATIAL"}; SYM_GROUP sym_group_rtree= {"RTree keys", "HAVE_RTREE_KEYS"}; /* We don't want to include sql_yacc.h into gen_lex_hash */ diff --git a/sql/lock.cc b/sql/lock.cc index 07021bae9ca..43d8b0ce535 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -1069,7 +1069,7 @@ bool Global_read_lock::make_global_read_lock_block_commit(THD *thd) MDL_request mdl_request; DBUG_ENTER("make_global_read_lock_block_commit"); /* - If we didn't succeed lock_global_read_lock(), or if we already suceeded + If we didn't succeed lock_global_read_lock(), or if we already succeeded make_global_read_lock_block_commit(), do nothing. */ diff --git a/sql/log.cc b/sql/log.cc index fbc591cbebf..8049b94bab1 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -141,7 +141,7 @@ static rpl_binlog_state rpl_global_gtid_binlog_state; /** purge logs, master and slave sides both, related error code - convertor. + converter. Called from @c purge_error_message(), @c MYSQL_BIN_LOG::reset_logs() @param res an internal to purging routines error code @@ -350,7 +350,7 @@ public: never zero. This is done while calling the constructor binlog_cache_mngr. - We cannot set informaton in the constructor binlog_cache_data + We cannot set information in the constructor binlog_cache_data because the space for binlog_cache_mngr is allocated through a placement new. @@ -2958,7 +2958,7 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time, mysql_mutex_lock(&LOCK_log); if (is_open()) - { // Safety agains reopen + { // Safety against reopen int tmp_errno= 0; char buff[80], *end; char query_time_buff[22+7], lock_time_buff[22+7]; @@ -3233,7 +3233,7 @@ void MYSQL_BIN_LOG::cleanup() /* Free data for global binlog state. - We can't do that automaticly as we need to do this before + We can't do that automatically as we need to do this before safemalloc is shut down */ if (!is_relay_log) @@ -4004,7 +4004,7 @@ err: /** - Delete all logs refered to in the index file. + Delete all logs referred to in the index file. The new index file will only contain this file. @@ -4406,7 +4406,7 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included) /* * Need to update the log pos because purge logs has been called - * after fetching initially the log pos at the begining of the method. + * after fetching initially the log pos at the beginning of the method. */ if ((errcode= find_log_pos(&rli->linfo, rli->event_relay_log_name, 0))) { @@ -5563,7 +5563,7 @@ binlog_cache_mngr *THD::binlog_setup_trx_data() - Start a statement transaction to allow us to truncate the cache. - - Save the currrent binlog position so that we can roll back the + - Save the current binlog position so that we can roll back the statement by truncating the cache. We only update the saved position if the old one was undefined, @@ -6743,7 +6743,7 @@ static const char* get_first_binlog(char* buf_arg) } if (normalize_binlog_name(buf_arg, fname, false)) { - errmsg= "cound not normalize the first file name in the binlog index"; + errmsg= "could not normalize the first file name in the binlog index"; goto end; } end: @@ -9706,7 +9706,7 @@ TC_LOG_BINLOG::mark_xid_done(ulong binlog_id, bool write_checkpoint) than compare all found against each other to find the one pointing to the most recent binlog. - Note also that we need to first release LOCK_xid_list, then aquire + Note also that we need to first release LOCK_xid_list, then acquire LOCK_log, then re-aquire LOCK_xid_list. If we were to take LOCK_log while holding LOCK_xid_list, we might deadlock with other threads that take the locks in the opposite order. @@ -9780,7 +9780,7 @@ TC_LOG_BINLOG::commit_checkpoint_notify(void *cookie) necessary stuff. In the future, this thread could also be used to do log rotation in the - background, which could elimiate all stalls around binlog rotations. + background, which could eliminate all stalls around binlog rotations. */ pthread_handler_t binlog_background_thread(void *arg __attribute__((unused))) diff --git a/sql/log_event.cc b/sql/log_event.cc index bb3465ae9f0..a1a442df43f 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -3444,7 +3444,7 @@ get_str_len_and_pointer(const Log_event::Byte **src, const Log_event::Byte *end) { if (*src >= end) - return -1; // Will be UINT_MAX in two-complement arithmetics + return -1; // Will be UINT_MAX in two-complement arithmetic uint length= **src; if (length > 0) { @@ -3810,7 +3810,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, /* A 2nd variable part; this is common to all versions */ memcpy((char*) start, end, data_len); // Copy db and query - start[data_len]= '\0'; // End query with \0 (For safetly) + start[data_len]= '\0'; // End query with \0 (For safety) db= (char *)start; query= (char *)(start + db_len + 1); q_len= data_len - db_len -1; @@ -5403,7 +5403,7 @@ int Format_description_log_event::do_update_pos(rpl_group_info *rgi) If we do not skip stepping the group log position (and the server id was changed when restarting the server), it might well be that we start executing at a position that is invalid, e.g., - at a Rows_log_event or a Query_log_event preceeded by a + at a Rows_log_event or a Query_log_event preceded by a Intvar_log_event instead of starting at a Table_map_log_event or the Intvar_log_event respectively. */ @@ -5515,7 +5515,7 @@ Format_description_log_event::is_version_before_checksum(const master_version_sp @return the version-safe checksum alg descriptor where zero designates no checksum, 255 - the orginator is - checksum-unaware (effectively no checksum) and the actuall + checksum-unaware (effectively no checksum) and the actual [1-254] range alg descriptor. */ enum enum_binlog_checksum_alg get_checksum_alg(const char* buf, ulong len) @@ -6221,7 +6221,7 @@ int Load_log_event::do_apply_event(NET* net, rpl_group_info *rgi, /* When replication is running fine, if it was DUP_ERROR on the master then we could choose IGNORE here, because if DUP_ERROR - suceeded on master, and data is identical on the master and slave, + succeeded on master, and data is identical on the master and slave, then there should be no uniqueness errors on slave, so IGNORE is the same as DUP_ERROR. But in the unlikely case of uniqueness errors (because the data on the master and slave happen to be different @@ -6754,7 +6754,7 @@ Gtid_log_event::Gtid_log_event(THD *thd_arg, uint64 seq_no_arg, /* Used to record GTID while sending binlog to slave, without having to - fully contruct every Gtid_log_event() needlessly. + fully construct every Gtid_log_event() needlessly. */ bool Gtid_log_event::peek(const char *event_start, size_t event_len, @@ -7276,7 +7276,7 @@ Gtid_list_log_event::print(FILE *file, PRINT_EVENT_INFO *print_event_info) /* Used to record gtid_list event while sending binlog to slave, without having to - fully contruct the event object. + fully construct the event object. */ bool Gtid_list_log_event::peek(const char *event_start, uint32 event_len, @@ -7356,7 +7356,7 @@ Intvar_log_event::Intvar_log_event(const char* buf, const Format_description_log_event* description_event) :Log_event(buf, description_event) { - /* The Post-Header is empty. The Varible Data part begins immediately. */ + /* The Post-Header is empty. The Variable Data part begins immediately. */ buf+= description_event->common_header_len + description_event->post_header_len[INTVAR_EVENT-1]; type= buf[I_TYPE_OFFSET]; @@ -8135,7 +8135,7 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) return; str_to_hex(hex_str, val, val_len); /* - For proper behaviour when mysqlbinlog|mysql, we need to explicitely + For proper behaviour when mysqlbinlog|mysql, we need to explicitly specify the variable's collation. It will however cause problems when people want to mysqlbinlog|mysql into another server not supporting the character set. But there's not much to do about this and it's unlikely. @@ -8584,7 +8584,7 @@ void Create_file_log_event::pack_info(Protocol *protocol) /** Create_file_log_event::do_apply_event() - Constructor for Create_file_log_event to intantiate an event + Constructor for Create_file_log_event to instantiate an event from the relay log on the slave. @retval @@ -9629,7 +9629,7 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len, DBUG_VOID_RETURN; } - /* if my_bitmap_init fails, catched in is_valid() */ + /* if my_bitmap_init fails, caught in is_valid() */ if (likely(!my_bitmap_init(&m_cols, m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL, m_width, @@ -10010,7 +10010,7 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi) */ { - DBUG_PRINT("debug", ("Checking compability of tables to lock - tables_to_lock: %p", + DBUG_PRINT("debug", ("Checking compatibility of tables to lock - tables_to_lock: %p", rgi->tables_to_lock)); /** @@ -10065,7 +10065,7 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi) ptr->table->s->table_name.str)); /* We should not honour --slave-skip-errors at this point as we are - having severe errors which should not be skiped. + having severe errors which should not be skipped. */ thd->is_slave_error= 1; /* remove trigger's tables */ @@ -10446,7 +10446,7 @@ static int rows_event_stmt_cleanup(rpl_group_info *rgi, THD * thd) /** The method either increments the relay log position or commits the current statement and increments the master group - possition if the event is STMT_END_F flagged and + position if the event is STMT_END_F flagged and the statement corresponds to the autocommit query (i.e replicated without wrapping in BEGIN/COMMIT) @@ -10555,7 +10555,7 @@ void Rows_log_event::pack_info(Protocol *protocol) #ifdef MYSQL_CLIENT /** Print an event "body" cache to @c file possibly in two fragments. - Each fragement is optionally per @c do_wrap to produce an SQL statement. + Each fragment is optionally per @c do_wrap to produce an SQL statement. @param file a file to print to @param body the "body" IO_CACHE of event @@ -12177,7 +12177,7 @@ record_compare_exit: Find the best key to use when locating the row in @c find_row(). A primary key is preferred if it exists; otherwise a unique index is - preferred. Else we pick the index with the smalles rec_per_key value. + preferred. Else we pick the index with the smallest rec_per_key value. If a suitable key is found, set @c m_key, @c m_key_nr and @c m_key_info member fields appropriately. @@ -12310,7 +12310,7 @@ static int row_not_found_error(rpl_group_info *rgi) Locate the current row in event's table. The current row is pointed by @c m_curr_row. Member @c m_width tells - how many columns are there in the row (this can be differnet from + how many columns are there in the row (this can be different from the number of columns in the table). It is assumed that event's table is already open and pointed by @c m_table. @@ -12351,7 +12351,7 @@ int Rows_log_event::find_row(rpl_group_info *rgi) rpl_row_tabledefs.test specifies that if the extra field on the slave does not have a default value and this is okay with Delete or Update events. - Todo: fix wl3228 hld that requires defauls for all types of events + Todo: fix wl3228 hld that requires defaults for all types of events */ prepare_record(table, m_width, FALSE); @@ -12595,7 +12595,7 @@ int Rows_log_event::find_row(rpl_group_info *rgi) while (record_compare(table)); /* - Note: above record_compare will take into accout all record fields + Note: above record_compare will take into account all record fields which might be incorrect in case a partial row was given in the event */ diff --git a/sql/log_event.h b/sql/log_event.h index 1337e9a7d69..bdac9f2e581 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -452,7 +452,7 @@ class String; /** @def LOG_EVENT_ARTIFICIAL_F - Artificial events are created arbitarily and not written to binary + Artificial events are created arbitrarily and not written to binary log These events should not update the master log position when slave @@ -854,13 +854,13 @@ private: }; /** - the struct aggregates two paramenters that identify an event + the struct aggregates two parameters that identify an event uniquely in scope of communication of a particular master and slave couple. I.e there can not be 2 events from the same staying connected master which have the same coordinates. @note Such identifier is not yet unique generally as the event originating master - is resetable. Also the crashed master can be replaced with some other. + is resettable. Also the crashed master can be replaced with some other. */ typedef struct event_coordinates { @@ -2594,7 +2594,7 @@ public: uint8 number_of_event_types; /* The list of post-headers' lengths followed - by the checksum alg decription byte + by the checksum alg description byte */ uint8 *post_header_len; struct master_version_split { @@ -2934,7 +2934,7 @@ public: */ bool is_deferred() { return deferred; } /* - In case of the deffered applying the variable instance is flagged + In case of the deferred applying the variable instance is flagged and the parsing time query id is stored to be used at applying time. */ void set_deferred(query_id_t qid) { deferred= true; query_id= qid; } @@ -3428,7 +3428,7 @@ public: bool write_data_header(); bool write_data_body(); /* - Cut out Create_file extentions and + Cut out Create_file extensions and write it as Load event - used on the slave */ bool write_base(); @@ -4738,7 +4738,7 @@ protected: /** @class Incident_log_event - Class representing an incident, an occurance out of the ordinary, + Class representing an incident, an occurence out of the ordinary, that happened on the master. The event is used to inform the slave that something out of the @@ -4782,7 +4782,7 @@ public: m_message.str= NULL; /* Just as a precaution */ m_message.length= 0; set_direct_logging(); - /* Replicate the incident irregardless of @@skip_replication. */ + /* Replicate the incident regardless of @@skip_replication. */ flags&= ~LOG_EVENT_SKIP_REPLICATION_F; DBUG_VOID_RETURN; } @@ -4803,7 +4803,7 @@ public: strmake(m_message.str, msg.str, msg.length); m_message.length= msg.length; set_direct_logging(); - /* Replicate the incident irregardless of @@skip_replication. */ + /* Replicate the incident regardless of @@skip_replication. */ flags&= ~LOG_EVENT_SKIP_REPLICATION_F; DBUG_VOID_RETURN; } diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index f70fa3605d6..0a4d7227dfb 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -846,7 +846,7 @@ int Write_rows_log_event_old::do_after_row_operations(TABLE *table, int error) table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE); /* - reseting the extra with + resetting the extra with table->file->extra(HA_EXTRA_NO_IGNORE_NO_KEY); fires bug#27077 todo: explain or fix @@ -1238,7 +1238,7 @@ Old_rows_log_event::Old_rows_log_event(const char *buf, uint event_len, DBUG_VOID_RETURN; } - /* if my_bitmap_init fails, catched in is_valid() */ + /* if my_bitmap_init fails, caught in is_valid() */ if (likely(!my_bitmap_init(&m_cols, m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL, m_width, From 52ccedd6dd50e8e5cd8ca9b1be84bc5e87c20950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 23 Jul 2020 09:59:16 +0300 Subject: [PATCH 06/35] MDEV-23268 SIGSEGV on srv_monitor_event if InnoDB is read-only The srv_monitor_event and the srv_monitor_thread would not be created when InnoDB is in read-only mode. Yet, some code would unconditionally invoke os_event_set(srv_monitor_event). --- .../innodb/r/read_only_recover_committed.result | 1 + .../suite/innodb/t/read_only_recover_committed.test | 1 + storage/innobase/buf/buf0lru.cc | 4 ++-- storage/innobase/handler/ha_innodb.cc | 13 ++++++++----- storage/innobase/sync/sync0arr.cc | 4 ++-- storage/xtradb/buf/buf0lru.cc | 4 ++-- storage/xtradb/handler/ha_innodb.cc | 13 ++++++++----- storage/xtradb/sync/sync0arr.cc | 4 ++-- 8 files changed, 26 insertions(+), 18 deletions(-) diff --git a/mysql-test/suite/innodb/r/read_only_recover_committed.result b/mysql-test/suite/innodb/r/read_only_recover_committed.result index 593bcae40ee..45e9df65819 100644 --- a/mysql-test/suite/innodb/r/read_only_recover_committed.result +++ b/mysql-test/suite/innodb/r/read_only_recover_committed.result @@ -26,6 +26,7 @@ a 1 UPDATE t SET a=3 WHERE a=1; ERROR HY000: Table 't' is read only +SET GLOBAL innodb_status_output= @@GLOBAL.innodb_status_output; # Starting with MariaDB 10.2, innodb_read_only implies READ UNCOMMITTED. # In earlier versions, this would return the last committed version # (empty table)! diff --git a/mysql-test/suite/innodb/t/read_only_recover_committed.test b/mysql-test/suite/innodb/t/read_only_recover_committed.test index 402cbeba1b9..b14aeaee388 100644 --- a/mysql-test/suite/innodb/t/read_only_recover_committed.test +++ b/mysql-test/suite/innodb/t/read_only_recover_committed.test @@ -53,6 +53,7 @@ SELECT * FROM t; UPDATE t SET a=3 WHERE a=1; --let $restart_parameters= --innodb-read-only --source include/restart_mysqld.inc +SET GLOBAL innodb_status_output= @@GLOBAL.innodb_status_output; --echo # Starting with MariaDB 10.2, innodb_read_only implies READ UNCOMMITTED. --echo # In earlier versions, this would return the last committed version --echo # (empty table)! diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc index 29fe81dc920..28f1a41f9bf 100644 --- a/storage/innobase/buf/buf0lru.cc +++ b/storage/innobase/buf/buf0lru.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2019, MariaDB Corporation. +Copyright (c) 2017, 2020, MariaDB Corporation. 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 the Free Software @@ -981,7 +981,7 @@ buf_LRU_check_size_of_non_data_objects( + UT_LIST_GET_LEN(buf_pool->LRU)) < buf_pool->curr_size / 3) { - if (!buf_lru_switched_on_innodb_mon) { + if (!buf_lru_switched_on_innodb_mon && srv_monitor_event) { /* Over 67 % of the buffer pool is occupied by lock heaps or the adaptive hash index. This may be a memory diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 2dd20927545..9ca8fe86ec6 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -18480,11 +18480,14 @@ static void innodb_status_output_update(THD*,st_mysql_sys_var*,void*var,const void*save) { - *static_cast(var) = *static_cast(save); - mysql_mutex_unlock(&LOCK_global_system_variables); - /* Wakeup server monitor thread. */ - os_event_set(srv_monitor_event); - mysql_mutex_lock(&LOCK_global_system_variables); + *static_cast(var)= *static_cast(save); + if (srv_monitor_event) + { + mysql_mutex_unlock(&LOCK_global_system_variables); + /* Wakeup server monitor thread. */ + os_event_set(srv_monitor_event); + mysql_mutex_lock(&LOCK_global_system_variables); + } } /** Update the system variable innodb_encryption_threads. diff --git a/storage/innobase/sync/sync0arr.cc b/storage/innobase/sync/sync0arr.cc index 9af6cfe5f0c..f3eaa1fbf86 100644 --- a/storage/innobase/sync/sync0arr.cc +++ b/storage/innobase/sync/sync0arr.cc @@ -2,7 +2,7 @@ Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. -Copyright (c) 2013, 2019, MariaDB Corporation. +Copyright (c) 2013, 2020, MariaDB Corporation. Portions of this file contain modifications contributed and copyrighted by Google, Inc. Those modifications are gratefully acknowledged and are described @@ -1077,7 +1077,7 @@ sync_array_print_long_waits( sync_array_exit(arr); } - if (noticed) { + if (noticed && srv_monitor_event) { ibool old_val; fprintf(stderr, diff --git a/storage/xtradb/buf/buf0lru.cc b/storage/xtradb/buf/buf0lru.cc index 13bf5e79f2d..9a577bc3010 100644 --- a/storage/xtradb/buf/buf0lru.cc +++ b/storage/xtradb/buf/buf0lru.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2019, MariaDB Corporation. +Copyright (c) 2017, 2020, MariaDB Corporation. 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 the Free Software @@ -1049,7 +1049,7 @@ buf_LRU_check_size_of_non_data_objects( + UT_LIST_GET_LEN(buf_pool->LRU)) < buf_pool->curr_size / 3) { - if (!buf_lru_switched_on_innodb_mon) { + if (!buf_lru_switched_on_innodb_mon && srv_monitor_event) { /* Over 67 % of the buffer pool is occupied by lock heaps or the adaptive hash index. This may be a memory diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 0a77ce56eaf..1cbe334ef09 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -19457,11 +19457,14 @@ static void innodb_status_output_update(THD*,st_mysql_sys_var*,void*var,const void*save) { - *static_cast(var) = *static_cast(save); - mysql_mutex_unlock(&LOCK_global_system_variables); - /* Wakeup server monitor thread. */ - os_event_set(srv_monitor_event); - mysql_mutex_lock(&LOCK_global_system_variables); + *static_cast(var)= *static_cast(save); + if (srv_monitor_event) + { + mysql_mutex_unlock(&LOCK_global_system_variables); + /* Wakeup server monitor thread. */ + os_event_set(srv_monitor_event); + mysql_mutex_lock(&LOCK_global_system_variables); + } } /** Update the system variable innodb_encryption_threads. diff --git a/storage/xtradb/sync/sync0arr.cc b/storage/xtradb/sync/sync0arr.cc index c085e8ebcf5..4de46089790 100644 --- a/storage/xtradb/sync/sync0arr.cc +++ b/storage/xtradb/sync/sync0arr.cc @@ -2,7 +2,7 @@ Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. -Copyright (c) 2013, 2019, MariaDB Corporation. +Copyright (c) 2013, 2020, MariaDB Corporation. Portions of this file contain modifications contributed and copyrighted by Google, Inc. Those modifications are gratefully acknowledged and are described @@ -1164,7 +1164,7 @@ sync_array_print_long_waits( sync_array_exit(arr); } - if (noticed) { + if (noticed && srv_monitor_event) { ibool old_val; fprintf(stderr, From adeb736f9aa5322e58612cdf1d57826067d3bdb4 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Thu, 23 Jul 2020 16:34:38 +0530 Subject: [PATCH 07/35] MDEV-22903 heap-use-after-free while accessing fts cache deleted doc ids Problem: ======= fts_cache_append_deleted_doc_ids() holds the deleted_lock and tries to access size of deleted_doc_ids. In the meantime, fts_cache_clear() clears the sync_heap before clearing deleted_doc_ids. It leads to invalid access of deleted_doc_ids. Fix: === fts_cache_clear() should free the sync_heap after clearing deleted_doc_ids. --- storage/innobase/fts/fts0fts.cc | 6 +++--- storage/xtradb/fts/fts0fts.cc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc index 54cf2f11884..2a1341c4cf0 100644 --- a/storage/innobase/fts/fts0fts.cc +++ b/storage/innobase/fts/fts0fts.cc @@ -1127,14 +1127,14 @@ fts_cache_clear( index_cache->doc_stats = NULL; } - mem_heap_free(static_cast(cache->sync_heap->arg)); - cache->sync_heap->arg = NULL; - cache->total_size = 0; mutex_enter((ib_mutex_t*) &cache->deleted_lock); cache->deleted_doc_ids = NULL; mutex_exit((ib_mutex_t*) &cache->deleted_lock); + + mem_heap_free(static_cast(cache->sync_heap->arg)); + cache->sync_heap->arg = NULL; } /*********************************************************************//** diff --git a/storage/xtradb/fts/fts0fts.cc b/storage/xtradb/fts/fts0fts.cc index 54cf2f11884..2a1341c4cf0 100644 --- a/storage/xtradb/fts/fts0fts.cc +++ b/storage/xtradb/fts/fts0fts.cc @@ -1127,14 +1127,14 @@ fts_cache_clear( index_cache->doc_stats = NULL; } - mem_heap_free(static_cast(cache->sync_heap->arg)); - cache->sync_heap->arg = NULL; - cache->total_size = 0; mutex_enter((ib_mutex_t*) &cache->deleted_lock); cache->deleted_doc_ids = NULL; mutex_exit((ib_mutex_t*) &cache->deleted_lock); + + mem_heap_free(static_cast(cache->sync_heap->arg)); + cache->sync_heap->arg = NULL; } /*********************************************************************//** From 7d22d666d2f91689e00c4eadc859c523cd9277ba Mon Sep 17 00:00:00 2001 From: Ian Gilfillan Date: Mon, 20 Jul 2020 12:02:00 +0200 Subject: [PATCH 08/35] MDEV-15207: mysql_upgrade cannot create file mysql_upgrade_info --- man/mysql_upgrade.1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/man/mysql_upgrade.1 b/man/mysql_upgrade.1 index 0d4d15d84d2..a083be5ce85 100644 --- a/man/mysql_upgrade.1 +++ b/man/mysql_upgrade.1 @@ -1,6 +1,6 @@ '\" t .\" -.TH "\FBMYSQL_UPGRADE\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System" +.TH "\FBMYSQL_UPGRADE\FR" "1" "20 July 2020" "MariaDB 10\&.1" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -165,6 +165,8 @@ in the data directory\&. This is used to quickly check whether all tables have b \fB\-\-force\fR option\&. .PP +For this reason, \fBmysql_upgrade\fR needs to be run as a user with write access to the data directory\&. +.PP If you install MariaDB from RPM packages on Linux, you must install the server and client RPMs\&. \fBmysql_upgrade\fR is included in the server RPM but requires the client RPM because the latter includes From 8ef41c60847be839914b04951852df82c61ae6a2 Mon Sep 17 00:00:00 2001 From: Teemu Ollakka Date: Thu, 23 Jul 2020 14:48:07 +0300 Subject: [PATCH 09/35] MDEV-23272 Galera stack-use-after-scope error with ASAN build THD proc info was assigned from stack allocated temporary buffer which went out of scope immediately after assignment. Fixed by removing the use of temp buffer and assign proc info from string literal. --- storage/innobase/handler/ha_innodb.cc | 9 --------- storage/xtradb/handler/ha_innodb.cc | 9 --------- 2 files changed, 18 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 9ca8fe86ec6..10098a2fa4d 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -4188,16 +4188,7 @@ innobase_commit_low( #ifdef WITH_WSREP const char* tmp = 0; if (trx->is_wsrep()) { -#ifdef WSREP_PROC_INFO - char info[64]; - info[sizeof(info) - 1] = '\0'; - snprintf(info, sizeof(info) - 1, - "innobase_commit_low():trx_commit_for_mysql(%lld)", - (long long) wsrep_thd_trx_seqno(trx->mysql_thd)); - tmp = thd_proc_info(trx->mysql_thd, info); -#else tmp = thd_proc_info(trx->mysql_thd, "innobase_commit_low()"); -#endif /* WSREP_PROC_INFO */ } #endif /* WITH_WSREP */ if (trx_is_started(trx)) { diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 1cbe334ef09..bb324faf2b6 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -4678,16 +4678,7 @@ innobase_commit_low( #ifdef WITH_WSREP const char* tmp = 0; if (trx->is_wsrep()) { -#ifdef WSREP_PROC_INFO - char info[64]; - info[sizeof(info) - 1] = '\0'; - snprintf(info, sizeof(info) - 1, - "innobase_commit_low():trx_commit_for_mysql(%lld)", - (long long) wsrep_thd_trx_seqno(trx->mysql_thd)); - tmp = thd_proc_info(trx->mysql_thd, info); -#else tmp = thd_proc_info(trx->mysql_thd, "innobase_commit_low()"); -#endif /* WSREP_PROC_INFO */ } #endif /* WITH_WSREP */ if (trx_is_started(trx)) { From 4b97f14a3d692721a089afe8050a00fcfc230816 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Wed, 22 Jul 2020 11:20:32 +1000 Subject: [PATCH 10/35] mysql_install_db: help lists --defaults-file twice Removed duplicate. Also move the --no-defaults option close to the other "default*" options. --- scripts/mysql_install_db.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index adf521f89f6..67ec88c975c 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -67,6 +67,7 @@ Usage: $0 [OPTIONS] --cross-bootstrap For internal use. Used when building the MariaDB system tables on a different host than the target. --datadir=path The path to the MariaDB data directory. + --no-defaults Don't read default options from any option file. --defaults-extra-file=name Read this file after the global files are read. --defaults-file=name Only read default options from the given file name. @@ -79,8 +80,6 @@ Usage: $0 [OPTIONS] --help Display this help and exit. --ldata=path The path to the MariaDB data directory. Same as --datadir. - --no-defaults Don't read default options from any option file. - --defaults-file=path Read only this configuration file. --rpm For internal use. This option is used by RPM files during the MariaDB installation process. --skip-auth-anonymous-user From b000d6952f655f837bc8c241add196f80a997e63 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Fri, 24 Jul 2020 22:31:29 +0300 Subject: [PATCH 11/35] MDEV-23221: A subquery causes crash * Fix the crash: IN-to-EXISTS rewrite causes an error (and so JOIN::optimize() fails with an error, too), don't call update_used_tables(). Terminate the query execution instead. * Fix the cause of the error in the IN-to-EXISTS rewrite: don't do the rewrite if doing it will cause an error of this kind: This version of MariaDB doesn't yet support 'SUBQUERY in ROW in left expression of IN/ALL/ANY' * Fix another issue exposed by this testcase: JOIN::setup_subquery_caches() may be invoked before any select has saved its query plan, and will crash because none of the SELECTs has called create_explain_query_if_not_exists() to create the Explain Data Structure for this SELECT. TODO: When merging this to 10.2, remove the poorly-placed call to create_explain_query_if_not_exists made by fix for M_D_E_V-16153 --- mysql-test/r/subselect_exists2in.result | 70 +++++++++++++++++++++++++ mysql-test/t/subselect_exists2in.test | 48 +++++++++++++++++ sql/item_subselect.cc | 20 ++++++- sql/sql_lex.cc | 3 +- sql/sql_select.cc | 2 +- 5 files changed, 139 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/subselect_exists2in.result b/mysql-test/r/subselect_exists2in.result index 18cd0567989..5a66aa2cd02 100644 --- a/mysql-test/r/subselect_exists2in.result +++ b/mysql-test/r/subselect_exists2in.result @@ -972,4 +972,74 @@ id DROP PROCEDURE p1; DROP TABLE t1; # End of 10.0 tests +# +# MDEV-23221: A subquery causes crash +# +create table t1 ( +location_code varchar(10), +country_id varchar(10) +); +insert into t1 values ('HKG', 'HK'); +insert into t1 values ('NYC', 'US'); +insert into t1 values ('LAX', 'US'); +create table t2 ( +container_id varchar(10), +cntr_activity_type varchar(10), +cntr_dest varchar(10) +); +insert into t2 values ('AAAA1111', 'VSL', 'NYC'); +insert into t2 values ('AAAA1111', 'CUV', 'NYC'); +insert into t2 values ('BBBB2222', 'VSL', 'LAX'); +insert into t2 values ('BBBB2222', 'XYZ', 'LAX'); +# Must not crash or return an error: +select +(select country_id from t1 where location_code = cl1.cntr_dest) as dest_cntry, +(select +max(container_id) +from t2 as cl2 +where +cl2.container_id = cl1.container_id and +cl2.cntr_activity_type = 'CUV' and +exists (select location_code +from t1 +where +location_code = cl2.cntr_dest and +country_id = dest_cntry) +) as CUV +from +t2 cl1; +dest_cntry CUV +US AAAA1111 +US AAAA1111 +US NULL +US NULL +prepare s from "select +(select country_id from t1 where location_code = cl1.cntr_dest) as dest_cntry, +(select +max(container_id) +from t2 as cl2 +where +cl2.container_id = cl1.container_id and +cl2.cntr_activity_type = 'CUV' and +exists (select location_code +from t1 +where +location_code = cl2.cntr_dest and +country_id = dest_cntry) +) as CUV +from +t2 cl1"; +execute s; +dest_cntry CUV +US AAAA1111 +US AAAA1111 +US NULL +US NULL +execute s; +dest_cntry CUV +US AAAA1111 +US AAAA1111 +US NULL +US NULL +drop table t1,t2; set optimizer_switch=default; diff --git a/mysql-test/t/subselect_exists2in.test b/mysql-test/t/subselect_exists2in.test index 5a8ddb3612f..877475f97ed 100644 --- a/mysql-test/t/subselect_exists2in.test +++ b/mysql-test/t/subselect_exists2in.test @@ -828,5 +828,53 @@ DROP TABLE t1; --echo # End of 10.0 tests +--echo # +--echo # MDEV-23221: A subquery causes crash +--echo # +create table t1 ( +location_code varchar(10), +country_id varchar(10) +); +insert into t1 values ('HKG', 'HK'); +insert into t1 values ('NYC', 'US'); +insert into t1 values ('LAX', 'US'); + +create table t2 ( +container_id varchar(10), +cntr_activity_type varchar(10), +cntr_dest varchar(10) +); +insert into t2 values ('AAAA1111', 'VSL', 'NYC'); +insert into t2 values ('AAAA1111', 'CUV', 'NYC'); +insert into t2 values ('BBBB2222', 'VSL', 'LAX'); +insert into t2 values ('BBBB2222', 'XYZ', 'LAX'); + +let $query= +select + (select country_id from t1 where location_code = cl1.cntr_dest) as dest_cntry, + (select + max(container_id) + from t2 as cl2 + where + cl2.container_id = cl1.container_id and + cl2.cntr_activity_type = 'CUV' and + exists (select location_code + from t1 + where + location_code = cl2.cntr_dest and + country_id = dest_cntry) + ) as CUV +from + t2 cl1; + +--echo # Must not crash or return an error: +eval $query; + +eval prepare s from "$query"; +execute s; +execute s; + +drop table t1,t2; + #restore defaults set optimizer_switch=default; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index b5f3cd052e2..0b28c15027d 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -2727,6 +2727,8 @@ bool Item_exists_subselect::select_prepare_to_be_in() Check if 'func' is an equality in form "inner_table.column = outer_expr" @param func Expression to check + @param allow_subselect If true, the outer_expr part can have a subquery + If false, it cannot. @param local_field OUT Return "inner_table.column" here @param outer_expr OUT Return outer_expr here @@ -2734,6 +2736,7 @@ bool Item_exists_subselect::select_prepare_to_be_in() */ static bool check_equality_for_exist2in(Item_func *func, + bool allow_subselect, Item_ident **local_field, Item **outer_exp) { @@ -2744,7 +2747,8 @@ static bool check_equality_for_exist2in(Item_func *func, args= func->arguments(); if (args[0]->real_type() == Item::FIELD_ITEM && args[0]->all_used_tables() != OUTER_REF_TABLE_BIT && - args[1]->all_used_tables() == OUTER_REF_TABLE_BIT) + args[1]->all_used_tables() == OUTER_REF_TABLE_BIT && + (allow_subselect || !args[1]->has_subquery())) { /* It is Item_field or Item_direct_view_ref) */ DBUG_ASSERT(args[0]->type() == Item::FIELD_ITEM || @@ -2755,7 +2759,8 @@ static bool check_equality_for_exist2in(Item_func *func, } else if (args[1]->real_type() == Item::FIELD_ITEM && args[1]->all_used_tables() != OUTER_REF_TABLE_BIT && - args[0]->all_used_tables() == OUTER_REF_TABLE_BIT) + args[0]->all_used_tables() == OUTER_REF_TABLE_BIT && + (allow_subselect || !args[0]->has_subquery())) { /* It is Item_field or Item_direct_view_ref) */ DBUG_ASSERT(args[1]->type() == Item::FIELD_ITEM || @@ -2784,6 +2789,13 @@ typedef struct st_eq_field_outer outer1=inner_tbl1.col1 AND ... AND outer2=inner_tbl1.col2 AND remainder_cond + if there is just one outer_expr=inner_expr pair, then outer_expr can have a + subselect in it. If there are many such pairs, then none of outer_expr can + have a subselect in it. If we allow this, the query will fail with an error: + + This version of MariaDB doesn't yet support 'SUBQUERY in ROW in left + expression of IN/ALL/ANY' + @param conds Condition to be checked @parm result Array to collect EQ_FIELD_OUTER elements describing inner-vs-outer equalities the function has found. @@ -2801,14 +2813,17 @@ static bool find_inner_outer_equalities(Item **conds, { List_iterator li(*((Item_cond*)*conds)->argument_list()); Item *item; + bool allow_subselect= true; while ((item= li++)) { if (item->type() == Item::FUNC_ITEM && check_equality_for_exist2in((Item_func *)item, + allow_subselect, &element.local_field, &element.outer_exp)) { found= TRUE; + allow_subselect= false; element.eq_ref= li.ref(); if (result.append(element)) goto alloc_err; @@ -2817,6 +2832,7 @@ static bool find_inner_outer_equalities(Item **conds, } else if ((*conds)->type() == Item::FUNC_ITEM && check_equality_for_exist2in((Item_func *)*conds, + true, &element.local_field, &element.outer_exp)) { diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 02c0df97cf3..e863308159e 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -3802,7 +3802,8 @@ bool st_select_lex::optimize_unflattened_subqueries(bool const_only) sl->options|= SELECT_DESCRIBE; inner_join->select_options|= SELECT_DESCRIBE; } - res= inner_join->optimize(); + if ((res= inner_join->optimize())) + return TRUE; if (!inner_join->cleaned) sl->update_used_tables(); sl->update_correlated_cache(); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 647dee80188..4c6e87e4f27 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1055,11 +1055,11 @@ int JOIN::optimize() if (optimization_state != JOIN::NOT_OPTIMIZED) return FALSE; optimization_state= JOIN::OPTIMIZATION_IN_PROGRESS; + create_explain_query_if_not_exists(thd->lex, thd->mem_root); int res= optimize_inner(); if (!res && have_query_plan != QEP_DELETED) { - create_explain_query_if_not_exists(thd->lex, thd->mem_root); have_query_plan= QEP_AVAILABLE; save_explain_data(thd->lex->explain, false /* can overwrite */, need_tmp, From 8460db12b5adb7337935d9a8a895eb72203343fc Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Sat, 25 Jul 2020 12:59:53 +0300 Subject: [PATCH 12/35] Add testcases for MDEV-20557, MDEV-21649 --- mysql-test/r/subselect_exists2in.result | 57 ++++++++++++++++++++++ mysql-test/t/subselect_exists2in.test | 64 +++++++++++++++++++++++++ 2 files changed, 121 insertions(+) diff --git a/mysql-test/r/subselect_exists2in.result b/mysql-test/r/subselect_exists2in.result index 5a66aa2cd02..23b252c92d6 100644 --- a/mysql-test/r/subselect_exists2in.result +++ b/mysql-test/r/subselect_exists2in.result @@ -1042,4 +1042,61 @@ US AAAA1111 US NULL US NULL drop table t1,t2; +# +# MDEV-20557: SQL query with duplicate table aliases consistently crashes server +# (Just a testcase) +# +create table t1 (id int, id2 int); +create table t2 (id int, id2 int, a int); +create table t3 (id int); +create table t4 (id int); +select (select 1 from t1 where (exists +(select 1 from t2 +where t2.a = (select t4.id from t4 where t4.id = t3.id) and t2.id2 = t1.id2))) dt +from t3; +ERROR 42000: This version of MariaDB doesn't yet support 'SUBQUERY in ROW in left expression of IN/ALL/ANY' +drop table t1,t2,t3,t4; +# +# MDEV-21649: Crash when using nested EXISTS +# (Just a testcase) +# +CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id)); +CREATE TABLE t2 (id INT NOT NULL AUTO_INCREMENT, ip_id INT, PRIMARY KEY(id)); +CREATE TABLE t3 (id INT NOT NULL AUTO_INCREMENT, storage_method_id INT, storage_target_id INT, PRIMARY KEY(id)); +SELECT +W0.`id` +FROM +`t1` W0 +WHERE ( +EXISTS( +SELECT +V0.`id` + FROM +`t2` V0 +WHERE ( +EXISTS( +SELECT +U0.`id` + FROM +`t2` U0 +INNER JOIN `t3` U4 ON (U0.`id` = U4.`storage_target_id`) +WHERE ( +U0.`ip_id` = V0.`ip_id` + AND U4.`storage_method_id` = ( +SELECT +U5.`storage_method_id` + FROM +`t3` U5 +WHERE +U5.`storage_target_id` = V0.`id` + LIMIT +1 +) +) +) +) +) +); +id +drop table t1,t2,t3; set optimizer_switch=default; diff --git a/mysql-test/t/subselect_exists2in.test b/mysql-test/t/subselect_exists2in.test index 877475f97ed..7ffb4bf0633 100644 --- a/mysql-test/t/subselect_exists2in.test +++ b/mysql-test/t/subselect_exists2in.test @@ -876,5 +876,69 @@ execute s; drop table t1,t2; +--echo # +--echo # MDEV-20557: SQL query with duplicate table aliases consistently crashes server +--echo # (Just a testcase) +--echo # + +create table t1 (id int, id2 int); +create table t2 (id int, id2 int, a int); +create table t3 (id int); +create table t4 (id int); + +--error ER_NOT_SUPPORTED_YET +select (select 1 from t1 where (exists + (select 1 from t2 + where t2.a = (select t4.id from t4 where t4.id = t3.id) and t2.id2 = t1.id2))) dt +from t3; + +drop table t1,t2,t3,t4; + + +--echo # +--echo # MDEV-21649: Crash when using nested EXISTS +--echo # (Just a testcase) +--echo # +CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id)); +CREATE TABLE t2 (id INT NOT NULL AUTO_INCREMENT, ip_id INT, PRIMARY KEY(id)); +CREATE TABLE t3 (id INT NOT NULL AUTO_INCREMENT, storage_method_id INT, storage_target_id INT, PRIMARY KEY(id)); + +SELECT + W0.`id` +FROM + `t1` W0 +WHERE ( + EXISTS( + SELECT + V0.`id` + FROM + `t2` V0 + WHERE ( + EXISTS( + SELECT + U0.`id` + FROM + `t2` U0 + INNER JOIN `t3` U4 ON (U0.`id` = U4.`storage_target_id`) + WHERE ( + U0.`ip_id` = V0.`ip_id` + AND U4.`storage_method_id` = ( + SELECT + U5.`storage_method_id` + FROM + `t3` U5 + WHERE + U5.`storage_target_id` = V0.`id` + LIMIT + 1 + ) + ) + ) + ) + ) +); + +drop table t1,t2,t3; + #restore defaults set optimizer_switch=default; From 29851b677ebbd954278d5530bde8e77fb865988f Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 24 Jul 2020 17:03:15 +0400 Subject: [PATCH 13/35] MDEV-23282 FLOAT(53,0) badly handles out-of-range values truncate_double() did not take into account the max_value limit in case when dec=2010e0; DROP TABLE t1; +--echo # +--echo # MDEV-23282 FLOAT(53,0) badly handles out-of-range values +--echo # + +CREATE OR REPLACE TABLE t1 (c1 FLOAT NOT NULL, c2 FLOAT NOT NULL); +INSERT IGNORE INTO t1 VALUES (1e+40, -1e+40); +SELECT c1, c2 FROM t1; +DROP TABLE t1; + +CREATE OR REPLACE TABLE t1 (c1 FLOAT(53,0) NOT NULL, c2 FLOAT(53,0) NOT NULL); +INSERT IGNORE INTO t1 VALUES (1e+40, -1e+40); +SELECT c1, c2 FROM t1; +DROP TABLE t1; + --echo # --echo # End of 10.1 tests --echo # diff --git a/sql/field.cc b/sql/field.cc index 5f0d340a1a5..32edff3dd2d 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4627,11 +4627,12 @@ int truncate_double(double *nr, uint field_length, uint dec, { uint order= field_length - dec; uint step= array_elements(log_10) - 1; - max_value= 1.0; + double max_value_by_dec= 1.0; for (; order > step; order-= step) - max_value*= log_10[step]; - max_value*= log_10[order]; - max_value-= 1.0 / log_10[dec]; + max_value_by_dec*= log_10[step]; + max_value_by_dec*= log_10[order]; + max_value_by_dec-= 1.0 / log_10[dec]; + set_if_smaller(max_value, max_value_by_dec); /* Check for infinity so we don't get NaN in calculations */ if (!my_isinf(res)) From c81a2d23224e11f59475dfd53878dbf5cf2130e4 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Mon, 27 Jul 2020 18:54:21 +1000 Subject: [PATCH 14/35] MDEV-23088: Change LimitNOFILE default from 16364 to 16384 Correct to a true 2^14 rather than some different number that was actually just a number typo. Bug report thanks to Hartmut Holzgraefe. --- support-files/mariadb.service.in | 2 +- support-files/mariadb@.service.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in index 1cc37dcc3e6..398b01f1f5d 100644 --- a/support-files/mariadb.service.in +++ b/support-files/mariadb.service.in @@ -134,7 +134,7 @@ TimeoutStopSec=900 ## # Number of files limit. previously [mysqld_safe] open-files-limit -LimitNOFILE=16364 +LimitNOFILE=16384 # Maximium core size. previously [mysqld_safe] core-file-size # LimitCore= diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in index 7b8c2b72cc0..b260349040b 100644 --- a/support-files/mariadb@.service.in +++ b/support-files/mariadb@.service.in @@ -155,7 +155,7 @@ TimeoutStopSec=900 ## # Number of files limit. previously [mysqld_safe] open-files-limit -LimitNOFILE=16364 +LimitNOFILE=16384 # Maximium core size. previously [mysqld_safe] core-file-size # LimitCore= From 1ce97358bbec29bedd59466ad199cf164ed063a3 Mon Sep 17 00:00:00 2001 From: Teodor Mircea Ionita Date: Mon, 27 Aug 2018 16:43:29 +0300 Subject: [PATCH 15/35] MDEV-17076: increment only if saving occurs --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 4e46f86e640..982eef810a6 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -724,9 +724,9 @@ sub run_test_server ($$$) { { mtr_report(" - saving '$worker_savedir/' to '$savedir/'"); rename($worker_savedir, $savedir); + $num_saved_datadir++; } resfile_print_test(); - $num_saved_datadir++; $num_failed_test++ unless ($result->{retries} || $result->{exp_fail}); From 99af3cbc854a4f9319c5c1f6db9f1289b4f773e1 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Wed, 22 Jul 2020 15:22:14 +1000 Subject: [PATCH 16/35] MDEV-17076: mtr max-{core,datadir} 0 means 0 There was no ability to set the mtr arguments of: * --max-save-core; and * --max-save-datadir to 0. This is desireable in an automatied scenario where space is limited hence targeting 10.1 branch. We take away the 0 means unlimited aspect for these, however, perl can handle some big numbers so they may as well be close enough to unlimited for all meaningful purposes. --- mysql-test/mysql-test-run.pl | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 982eef810a6..65fac0ce5be 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -697,8 +697,7 @@ sub run_test_server ($$$) { My::CoreDump->show($core_file, $exe_mysqld, $opt_parallel); # Limit number of core files saved - if ($opt_max_save_core > 0 && - $num_saved_cores >= $opt_max_save_core) + if ($num_saved_cores >= $opt_max_save_core) { mtr_report(" - deleting it, already saved", "$opt_max_save_core"); @@ -714,8 +713,7 @@ sub run_test_server ($$$) { }, $worker_savedir); - if ($opt_max_save_datadir > 0 && - $num_saved_datadir >= $opt_max_save_datadir) + if ($num_saved_datadir >= $opt_max_save_datadir) { mtr_report(" - skipping '$worker_savedir/'"); rmtree($worker_savedir); @@ -6220,12 +6218,12 @@ Options for debugging the product test(s) max-save-core Limit the number of core files saved (to avoid filling up disks for heavily crashing server). Defaults to - $opt_max_save_core, set to 0 for no limit. Set - it's default with MTR_MAX_SAVE_CORE + $opt_max_save_core. Set its default with + MTR_MAX_SAVE_CORE max-save-datadir Limit the number of datadir saved (to avoid filling up disks for heavily crashing server). Defaults to - $opt_max_save_datadir, set to 0 for no limit. Set - it's default with MTR_MAX_SAVE_DATADIR + $opt_max_save_datadir. Set its default with + MTR_MAX_SAVE_DATADIR max-test-fail Limit the number of test failures before aborting the current test run. Defaults to $opt_max_test_fail, set to 0 for no limit. Set From beec8404fa967bd2617a8da50a80930356877980 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Mon, 27 Jul 2020 11:51:50 +1000 Subject: [PATCH 17/35] MDEV-17076: mtr int options aren't negative --- mysql-test/mysql-test-run.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 65fac0ce5be..52920530132 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1277,6 +1277,17 @@ sub command_line_setup { report_option('verbose', $opt_verbose); } + # Negative values aren't meaningful on integer options + foreach(grep(/=i$/, keys %options)) + { + if (defined ${$options{$_}} && + do { no warnings "numeric"; int ${$options{$_}} < 0}) + { + my $v= (split /=/)[0]; + die("$v doesn't accept a negative value:"); + } + } + # Find the absolute path to the test directory $glob_mysql_test_dir= cwd(); if ($glob_mysql_test_dir =~ / /) From e6cb263ef3ecc59510b62f7c7dd5dfcd78a613c7 Mon Sep 17 00:00:00 2001 From: Karthik Kamath Date: Sun, 19 Jul 2020 11:10:12 +1000 Subject: [PATCH 18/35] MDEV-15961: Fix stacktraces under FreeBSD (aarch64) Largely based on MySQL commit https://github.com/mysql/mysql-server/commit/75271e51d60bce8683423b208cbb43b11ca6060e MySQL Ref: BUG#24566529: BACKPORT BUG#23575445 TO 5.6 (cut) Also, the PTR_SANE macro which tries to check if a pointer is invalid (used when printing pointer values in stack traces) gave false negatives on OSX/FreeBSD. On these platforms we now simply check if the pointer is non-null. This also removes a sbrk() deprecation warning when building on OS X. (It was before only disabled with building using XCode). Removed execinfo path of MySQL patch that was already included. sbrk doesn't exist on FreeBSD aarch64. Removed HAVE_BSS_START based detection and replaced with __linux__ as it doesn't exist on OSX, Solaris or Windows. __bss_start exists on mutiple Linux architectures. Tested on FreeBSD and Linux x86_64. Being in FreeBSD ports for 2 years implies a good testing there on all FreeBSD architectures there too. MySQL-8.0.21 code is functionally identical to original commit. --- cmake/os/WindowsCache.cmake | 1 - config.h.cmake | 1 - configure.cmake | 8 -------- mysys/stacktrace.c | 16 ++++++++-------- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake index a4d46df2af6..742f374e99f 100644 --- a/cmake/os/WindowsCache.cmake +++ b/cmake/os/WindowsCache.cmake @@ -35,7 +35,6 @@ SET(HAVE_BFILL CACHE INTERNAL "") SET(HAVE_BMOVE CACHE INTERNAL "") SET(HAVE_BSD_SIGNALS CACHE INTERNAL "") SET(HAVE_BSEARCH 1 CACHE INTERNAL "") -SET(HAVE_BSS_START CACHE INTERNAL "") SET(HAVE_BZERO CACHE INTERNAL "") SET(HAVE_CHOWN CACHE INTERNAL "") SET(HAVE_CLOCK_GETTIME CACHE INTERNAL "") diff --git a/config.h.cmake b/config.h.cmake index eb3e6228bf7..17e449fbab2 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -312,7 +312,6 @@ /* Symbols we may use */ #cmakedefine HAVE_SYS_ERRLIST 1 /* used by stacktrace functions */ -#cmakedefine HAVE_BSS_START 1 #cmakedefine HAVE_BACKTRACE 1 #cmakedefine HAVE_BACKTRACE_SYMBOLS 1 #cmakedefine HAVE_BACKTRACE_SYMBOLS_FD 1 diff --git a/configure.cmake b/configure.cmake index 8d477abc91b..36655fd4348 100644 --- a/configure.cmake +++ b/configure.cmake @@ -935,14 +935,6 @@ CHECK_CXX_SOURCE_COMPILES(" HAVE_ABI_CXA_DEMANGLE) ENDIF() -CHECK_C_SOURCE_COMPILES(" - int main(int argc, char **argv) - { - extern char *__bss_start; - return __bss_start ? 1 : 0; - }" -HAVE_BSS_START) - CHECK_C_SOURCE_COMPILES(" int main() { diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c index 7daed0df673..b31213b8488 100644 --- a/mysys/stacktrace.c +++ b/mysys/stacktrace.c @@ -34,19 +34,19 @@ #include #endif +#ifdef __linux__ #define PTR_SANE(p) ((p) && (char*)(p) >= heap_start && (char*)(p) <= heap_end) - static char *heap_start; - -#ifdef HAVE_BSS_START extern char *__bss_start; -#endif +#else +#define PTR_SANE(p) (p) +#endif /* __linux */ void my_init_stacktrace() { -#ifdef HAVE_BSS_START +#ifdef __linux__ heap_start = (char*) &__bss_start; -#endif +#endif /* __linux__ */ } #ifdef __linux__ @@ -149,15 +149,15 @@ static int safe_print_str(const char *addr, int max_len) int my_safe_print_str(const char* val, int max_len) { +#ifdef __linux__ char *heap_end; -#ifdef __linux__ // Try and make use of /proc filesystem to safely print memory contents. if (!safe_print_str(val, max_len)) return 0; -#endif heap_end= (char*) sbrk(0); +#endif if (!PTR_SANE(val)) { From 88cbe2f08193054ccf6565c2b27a8d809285a45b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 17 May 2020 18:34:22 +0200 Subject: [PATCH 19/35] MDEV-18496 Crash when Aria encryption is enabled but plugin not available wait_while_table_is_used() should return an error if handler::extra() fails --- mysql-test/suite/maria/encrypt-no-key.result | 9 +++++++++ mysql-test/suite/maria/encrypt-no-key.test | 13 +++++++++++++ sql/sql_base.cc | 2 +- storage/myisammrg/myrg_extra.c | 2 +- 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 mysql-test/suite/maria/encrypt-no-key.result create mode 100644 mysql-test/suite/maria/encrypt-no-key.test diff --git a/mysql-test/suite/maria/encrypt-no-key.result b/mysql-test/suite/maria/encrypt-no-key.result new file mode 100644 index 00000000000..4d15725648f --- /dev/null +++ b/mysql-test/suite/maria/encrypt-no-key.result @@ -0,0 +1,9 @@ +call mtr.add_suppression('Unknown key id 1. Can''t continue'); +set global aria_encrypt_tables= 1; +create table t1 (pk int primary key, a int, key(a)) engine=aria transactional=1; +alter table t1 disable keys; +insert into t1 values (1,1); +alter table t1 enable keys; +ERROR HY000: Unknown key id 1. Can't continue! +drop table t1; +set global aria_encrypt_tables= default; diff --git a/mysql-test/suite/maria/encrypt-no-key.test b/mysql-test/suite/maria/encrypt-no-key.test new file mode 100644 index 00000000000..ff2190f5a6e --- /dev/null +++ b/mysql-test/suite/maria/encrypt-no-key.test @@ -0,0 +1,13 @@ +# +# MDEV-18496 Crash when Aria encryption is enabled but plugin not available +# +call mtr.add_suppression('Unknown key id 1. Can''t continue'); + +set global aria_encrypt_tables= 1; +create table t1 (pk int primary key, a int, key(a)) engine=aria transactional=1; +alter table t1 disable keys; +insert into t1 values (1,1); +error 192; +alter table t1 enable keys; +drop table t1; +set global aria_encrypt_tables= default; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 3533c241fbc..76aab377985 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1892,7 +1892,7 @@ bool wait_while_table_is_used(THD *thd, TABLE *table, FALSE); /* extra() call must come only after all instances above are closed */ if (function != HA_EXTRA_NOT_USED) - (void) table->file->extra(function); + DBUG_RETURN(table->file->extra(function)); DBUG_RETURN(FALSE); } diff --git a/storage/myisammrg/myrg_extra.c b/storage/myisammrg/myrg_extra.c index 43dfc18c710..2b3861b9f7f 100644 --- a/storage/myisammrg/myrg_extra.c +++ b/storage/myisammrg/myrg_extra.c @@ -31,7 +31,7 @@ int myrg_extra(MYRG_INFO *info,enum ha_extra_function function, DBUG_PRINT("info",("function: %lu", (ulong) function)); if (!info->children_attached) - DBUG_RETURN(1); + DBUG_RETURN(0); if (function == HA_EXTRA_CACHE) { info->cache_in_use=1; From 77b7f793f9e7504b39194f530edc0e314569ea1c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 17 May 2020 18:44:23 +0200 Subject: [PATCH 20/35] MDEV-18496 Crash when Aria encryption is enabled but plugin not available fix uninitialized struct member --- mysql-test/suite/maria/encrypt-no-key.result | 6 ++++++ mysql-test/suite/maria/encrypt-no-key.test | 1 + storage/maria/ma_check.c | 1 + 3 files changed, 8 insertions(+) diff --git a/mysql-test/suite/maria/encrypt-no-key.result b/mysql-test/suite/maria/encrypt-no-key.result index 4d15725648f..6745670dfac 100644 --- a/mysql-test/suite/maria/encrypt-no-key.result +++ b/mysql-test/suite/maria/encrypt-no-key.result @@ -5,5 +5,11 @@ alter table t1 disable keys; insert into t1 values (1,1); alter table t1 enable keys; ERROR HY000: Unknown key id 1. Can't continue! +repair table t1 use_frm; +Table Op Msg_type Msg_text +test.t1 repair warning Number of rows changed from 0 to 1 +test.t1 repair Error Unknown key id 1. Can't continue! +test.t1 repair Error Unknown key id 1. Can't continue! +test.t1 repair status OK drop table t1; set global aria_encrypt_tables= default; diff --git a/mysql-test/suite/maria/encrypt-no-key.test b/mysql-test/suite/maria/encrypt-no-key.test index ff2190f5a6e..2d586c50695 100644 --- a/mysql-test/suite/maria/encrypt-no-key.test +++ b/mysql-test/suite/maria/encrypt-no-key.test @@ -9,5 +9,6 @@ alter table t1 disable keys; insert into t1 values (1,1); error 192; alter table t1 enable keys; +repair table t1 use_frm; drop table t1; set global aria_encrypt_tables= default; diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index 789a4d0d5b6..8231cd47913 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -3198,6 +3198,7 @@ static int write_page(MARIA_SHARE *share, File file, args.page= buff; args.pageno= (pgcache_page_no_t) (pos / share->block_size); args.data= (uchar*) share; + args.crypt_buf= NULL; (* share->kfile.pre_write_hook)(&args); res= my_pwrite(file, args.page, block_size, pos, myf_rw); (* share->kfile.post_write_hook)(res, &args); From d5970779fac361a9ba56fccf0e9ed5b492b17d7e Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 12 Jun 2020 13:53:23 +0200 Subject: [PATCH 21/35] bugfix: mysql_create_view() infinite loop if mysql_create_view() is aborted when view is linked into lex (when WSREP_TO_ISOLATION_BEGIN fails), it should not be linked there again on err:. --- sql/sql_view.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sql/sql_view.cc b/sql/sql_view.cc index cb92f30c932..0984372fedc 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -442,9 +442,8 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, if (open_temporary_tables(thd, lex->query_tables) || open_and_lock_tables(thd, lex->query_tables, TRUE, 0)) { - view= lex->unlink_first_table(&link_to_local); res= TRUE; - goto err; + goto err_no_relink; } view= lex->unlink_first_table(&link_to_local); @@ -694,10 +693,12 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, WSREP_ERROR_LABEL: res= TRUE; + goto err_no_relink; err: THD_STAGE_INFO(thd, stage_end); lex->link_first_table_back(view, link_to_local); +err_no_relink: unit->cleanup(); DBUG_RETURN(res || thd->is_error()); } From 0b5b2f864153bf236a844e225ed6f04d79c757d8 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 24 Jul 2020 17:43:10 +0200 Subject: [PATCH 22/35] Bug #25207522: INCORRECT ORDER-BY BEHAVIOR ON A PARTITIONED TABLE WITH A COMPOSITE PREFIX INDEX Fix prefix key comparison in partitioning. Comparions must take into account no more than prefix_len characters. It used to compare prefix_len*mbmaxlen bytes. --- mysql-test/r/partition.result | 40 +++++++++++++++++++++ mysql-test/t/partition.test | 28 +++++++++++++++ sql/field.cc | 66 +++++++++++++++++++++++++++++------ sql/field.h | 22 ++++++------ sql/key.cc | 4 +-- 5 files changed, 136 insertions(+), 24 deletions(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 6cea712e482..57fa374d4f1 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -2756,5 +2756,45 @@ SELECT 1 FROM t1 WHERE a XOR 'a'; 1 DROP TABLE t1; # +# Bug #25207522: INCORRECT ORDER-BY BEHAVIOR ON A PARTITIONED TABLE +# WITH A COMPOSITE PREFIX INDEX +# +create table t1(id int unsigned not null, +data varchar(2) default null, +key data_idx (data(1),id) +) default charset=utf8 +partition by range (id) ( +partition p10 values less than (10), +partition p20 values less than (20) +); +insert t1 values (6, 'ab'), (4, 'ab'), (5, 'ab'), (16, 'ab'), (14, 'ab'), (15, 'ab'), (5, 'ac'), (15, 'aa') ; +select id from t1 where data = 'ab' order by id; +id +4 +5 +6 +14 +15 +16 +drop table t1; +create table t1(id int unsigned not null, +data text default null, +key data_idx (data(1),id) +) default charset=utf8 +partition by range (id) ( +partition p10 values less than (10), +partition p20 values less than (20) +); +insert t1 values (6, 'ab'), (4, 'ab'), (5, 'ab'), (16, 'ab'), (14, 'ab'), (15, 'ab'), (5, 'ac'), (15, 'aa') ; +select id from t1 where data = 'ab' order by id; +id +4 +5 +6 +14 +15 +16 +drop table t1; +# # End of 10.1 tests # diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 0f965cc810a..23f3fa0b4d8 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -2970,6 +2970,34 @@ CREATE TABLE t1(a BINARY(80)) PARTITION BY KEY(a) PARTITIONS 3; SELECT 1 FROM t1 WHERE a XOR 'a'; DROP TABLE t1; +--echo # +--echo # Bug #25207522: INCORRECT ORDER-BY BEHAVIOR ON A PARTITIONED TABLE +--echo # WITH A COMPOSITE PREFIX INDEX +--echo # +create table t1(id int unsigned not null, + data varchar(2) default null, + key data_idx (data(1),id) +) default charset=utf8 +partition by range (id) ( + partition p10 values less than (10), + partition p20 values less than (20) +); +insert t1 values (6, 'ab'), (4, 'ab'), (5, 'ab'), (16, 'ab'), (14, 'ab'), (15, 'ab'), (5, 'ac'), (15, 'aa') ; +select id from t1 where data = 'ab' order by id; +drop table t1; + +create table t1(id int unsigned not null, + data text default null, + key data_idx (data(1),id) +) default charset=utf8 +partition by range (id) ( + partition p10 values less than (10), + partition p20 values less than (20) +); +insert t1 values (6, 'ab'), (4, 'ab'), (5, 'ab'), (16, 'ab'), (14, 'ab'), (15, 'ab'), (5, 'ac'), (15, 'aa') ; +select id from t1 where data = 'ab' order by id; +drop table t1; + --echo # --echo # End of 10.1 tests --echo # diff --git a/sql/field.cc b/sql/field.cc index 32edff3dd2d..1ec5e8e5e41 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7537,8 +7537,7 @@ my_decimal *Field_varstring::val_decimal(my_decimal *decimal_value) } -int Field_varstring::cmp_max(const uchar *a_ptr, const uchar *b_ptr, - uint max_len) +int Field_varstring::cmp(const uchar *a_ptr, const uchar *b_ptr) { uint a_length, b_length; int diff; @@ -7553,8 +7552,8 @@ int Field_varstring::cmp_max(const uchar *a_ptr, const uchar *b_ptr, a_length= uint2korr(a_ptr); b_length= uint2korr(b_ptr); } - set_if_smaller(a_length, max_len); - set_if_smaller(b_length, max_len); + set_if_smaller(a_length, field_length); + set_if_smaller(b_length, field_length); diff= field_charset->coll->strnncollsp(field_charset, a_ptr+ length_bytes, @@ -7566,6 +7565,43 @@ int Field_varstring::cmp_max(const uchar *a_ptr, const uchar *b_ptr, } +static int cmp_str_prefix(const uchar *ua, size_t alen, const uchar *ub, + size_t blen, size_t prefix, CHARSET_INFO *cs) +{ + const char *a= (char*)ua, *b= (char*)ub; + MY_STRCOPY_STATUS status; + prefix/= cs->mbmaxlen; + alen= cs->cset->well_formed_char_length(cs, a, a + alen, prefix, &status); + blen= cs->cset->well_formed_char_length(cs, b, b + blen, prefix, &status); + return cs->coll->strnncollsp(cs, ua, alen, ub, blen, 0); +} + + + +int Field_varstring::cmp_prefix(const uchar *a_ptr, const uchar *b_ptr, + size_t prefix_len) +{ + /* avoid expensive well_formed_char_length if possible */ + if (prefix_len == table->field[field_index]->field_length) + return Field_varstring::cmp(a_ptr, b_ptr); + + size_t a_length, b_length; + + if (length_bytes == 1) + { + a_length= *a_ptr; + b_length= *b_ptr; + } + else + { + a_length= uint2korr(a_ptr); + b_length= uint2korr(b_ptr); + } + return cmp_str_prefix(a_ptr+length_bytes, a_length, b_ptr+length_bytes, + b_length, prefix_len, field_charset); +} + + /** @note varstring and blob keys are ALWAYS stored with a 2 byte length prefix @@ -8114,16 +8150,24 @@ int Field_blob::cmp(const uchar *a,uint32 a_length, const uchar *b, } -int Field_blob::cmp_max(const uchar *a_ptr, const uchar *b_ptr, - uint max_length) +int Field_blob::cmp(const uchar *a_ptr, const uchar *b_ptr) { uchar *blob1,*blob2; memcpy(&blob1, a_ptr+packlength, sizeof(char*)); memcpy(&blob2, b_ptr+packlength, sizeof(char*)); - uint a_len= get_length(a_ptr), b_len= get_length(b_ptr); - set_if_smaller(a_len, max_length); - set_if_smaller(b_len, max_length); - return Field_blob::cmp(blob1,a_len,blob2,b_len); + size_t a_len= get_length(a_ptr), b_len= get_length(b_ptr); + return cmp(blob1, a_len, blob2, b_len); +} + + +int Field_blob::cmp_prefix(const uchar *a_ptr, const uchar *b_ptr, + size_t prefix_len) +{ + uchar *blob1,*blob2; + memcpy(&blob1, a_ptr+packlength, sizeof(char*)); + memcpy(&blob2, b_ptr+packlength, sizeof(char*)); + size_t a_len= get_length(a_ptr), b_len= get_length(b_ptr); + return cmp_str_prefix(blob1, a_len, blob2, b_len, prefix_len, field_charset); } @@ -9407,7 +9451,7 @@ my_decimal *Field_bit::val_decimal(my_decimal *deciaml_value) The a and b pointer must be pointers to the field in a record (not the table->record[0] necessarily) */ -int Field_bit::cmp_max(const uchar *a, const uchar *b, uint max_len) +int Field_bit::cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len) { my_ptrdiff_t a_diff= a - ptr; my_ptrdiff_t b_diff= b - ptr; diff --git a/sql/field.h b/sql/field.h index e21994e3087..27a3f130aa7 100644 --- a/sql/field.h +++ b/sql/field.h @@ -954,9 +954,13 @@ public: return type(); } inline int cmp(const uchar *str) { return cmp(ptr,str); } - virtual int cmp_max(const uchar *a, const uchar *b, uint max_len) - { return cmp(a, b); } virtual int cmp(const uchar *,const uchar *)=0; + /* + The following method is used for comparing prefix keys. + Currently it's only used in partitioning. + */ + virtual int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len) + { return cmp(a, b); } virtual int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0L) { return memcmp(a,b,pack_length()); } virtual int cmp_offset(uint row_offset) @@ -2991,11 +2995,8 @@ public: longlong val_int(void); String *val_str(String*,String *); my_decimal *val_decimal(my_decimal *); - int cmp_max(const uchar *, const uchar *, uint max_length); - int cmp(const uchar *a,const uchar *b) - { - return cmp_max(a, b, ~0L); - } + int cmp(const uchar *a,const uchar *b); + int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len); void sort_string(uchar *buff,uint length); uint get_key_image(uchar *buff,uint length, imagetype type); void set_key_image(const uchar *buff,uint length); @@ -3077,9 +3078,8 @@ public: longlong val_int(void); String *val_str(String*,String *); my_decimal *val_decimal(my_decimal *); - int cmp_max(const uchar *, const uchar *, uint max_length); - int cmp(const uchar *a,const uchar *b) - { return cmp_max(a, b, ~0L); } + int cmp(const uchar *a,const uchar *b); + int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len); int cmp(const uchar *a, uint32 a_length, const uchar *b, uint32 b_length); int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0L); int key_cmp(const uchar *,const uchar*); @@ -3399,7 +3399,7 @@ public: } int cmp_binary_offset(uint row_offset) { return cmp_offset(row_offset); } - int cmp_max(const uchar *a, const uchar *b, uint max_length); + int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len); int key_cmp(const uchar *a, const uchar *b) { return cmp_binary((uchar *) a, (uchar *) b); } int key_cmp(const uchar *str, uint length); diff --git a/sql/key.cc b/sql/key.cc index 013733db62a..9b09387885b 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -623,8 +623,8 @@ int key_rec_cmp(void *key_p, uchar *first_rec, uchar *second_rec) max length. The exceptions are the BLOB and VARCHAR field types that take the max length into account. */ - if ((result= field->cmp_max(field->ptr+first_diff, field->ptr+sec_diff, - key_part->length))) + if ((result= field->cmp_prefix(field->ptr+first_diff, field->ptr+sec_diff, + key_part->length))) DBUG_RETURN(result); next_loop: key_part++; From 2ba70f69fd6cb3508de2744191c200c11d2fcd5f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 29 Jul 2020 12:05:12 +0200 Subject: [PATCH 23/35] cleanup: reduce code duplication --- sql/sql_acl.cc | 55 ++++++++++++++++------------------------------- sql/sql_base.cc | 12 ++++------- sql/sql_update.cc | 3 +-- 3 files changed, 23 insertions(+), 47 deletions(-) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 8d594e887b7..b2703dba76f 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -7130,6 +7130,17 @@ err: } +static void check_grant_column_int(GRANT_TABLE *grant_table, const char *name, + uint length, ulong *want_access) +{ + if (grant_table) + { + GRANT_COLUMN *grant_column= column_hash_search(grant_table, name, length); + if (grant_column) + *want_access&= ~grant_column->rights; + } +} + /* Check column rights in given security context @@ -7152,9 +7163,6 @@ bool check_grant_column(THD *thd, GRANT_INFO *grant, const char *db_name, const char *table_name, const char *name, uint length, Security_context *sctx) { - GRANT_TABLE *grant_table; - GRANT_TABLE *grant_table_role; - GRANT_COLUMN *grant_column; ulong want_access= grant->want_privilege & ~grant->privilege; DBUG_ENTER("check_grant_column"); DBUG_PRINT("enter", ("table: %s want_access: %lu", table_name, want_access)); @@ -7179,45 +7187,18 @@ bool check_grant_column(THD *thd, GRANT_INFO *grant, grant->version= grant_version; /* purecov: inspected */ } - grant_table= grant->grant_table_user; - grant_table_role= grant->grant_table_role; + check_grant_column_int(grant->grant_table_user, name, length, &want_access); + check_grant_column_int(grant->grant_table_role, name, length, &want_access); - if (!grant_table && !grant_table_role) - goto err; - - if (grant_table) - { - grant_column= column_hash_search(grant_table, name, length); - if (grant_column) - { - want_access&= ~grant_column->rights; - } - } - if (grant_table_role) - { - grant_column= column_hash_search(grant_table_role, name, length); - if (grant_column) - { - want_access&= ~grant_column->rights; - } - } - if (!want_access) - { - mysql_rwlock_unlock(&LOCK_grant); - DBUG_RETURN(0); - } - -err: mysql_rwlock_unlock(&LOCK_grant); + if (!want_access) + DBUG_RETURN(0); + char command[128]; get_privilege_desc(command, sizeof(command), want_access); /* TODO perhaps error should print current rolename aswell */ - my_error(ER_COLUMNACCESS_DENIED_ERROR, MYF(0), - command, - sctx->priv_user, - sctx->host_or_ip, - name, - table_name); + my_error(ER_COLUMNACCESS_DENIED_ERROR, MYF(0), command, sctx->priv_user, + sctx->host_or_ip, name, table_name); DBUG_RETURN(1); } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 76aab377985..1031a384d71 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -8306,15 +8306,11 @@ bool setup_tables(THD *thd, Name_resolution_context *context, FALSE ok; In this case *map will include the chosen index TRUE error */ -bool setup_tables_and_check_access(THD *thd, - Name_resolution_context *context, +bool setup_tables_and_check_access(THD *thd, Name_resolution_context *context, List *from_clause, - TABLE_LIST *tables, - List &leaves, - bool select_insert, - ulong want_access_first, - ulong want_access, - bool full_table_list) + TABLE_LIST *tables, List &leaves, + bool select_insert, ulong want_access_first, + ulong want_access, bool full_table_list) { DBUG_ENTER("setup_tables_and_check_access"); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 1360bf9fb74..9b2d24c3ba3 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -1119,8 +1119,7 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list, DBUG_RETURN(TRUE); if (setup_tables_and_check_access(thd, &select_lex->context, - &select_lex->top_join_list, - table_list, + &select_lex->top_join_list, table_list, select_lex->leaf_tables, FALSE, UPDATE_ACL, SELECT_ACL, TRUE) || setup_conds(thd, table_list, select_lex->leaf_tables, conds) || From e54a7ac1b38f77b64a0aafeb165082a9788d56f8 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 29 Jul 2020 12:17:31 +0200 Subject: [PATCH 24/35] MDEV-23010 UPDATE privilege at Database and Table level fail to update with SELECT command denied to user check both column- and table-level grants when looking for SELECT privilege on UPDATE statement. --- mysql-test/r/grant5.result | 10 ++++++++++ mysql-test/t/grant5.test | 22 ++++++++++++++++++++++ sql/sql_acl.cc | 10 +++++++--- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/grant5.result b/mysql-test/r/grant5.result index 8c32d90a640..01ec063c1d9 100644 --- a/mysql-test/r/grant5.result +++ b/mysql-test/r/grant5.result @@ -23,3 +23,13 @@ ERROR HY000: Table 'user' was not locked with LOCK TABLES REVOKE PROCESS ON *.* FROM u; ERROR HY000: Table 'user' was not locked with LOCK TABLES DROP TABLE t1; +create database mysqltest1; +use mysqltest1; +create table t1(id int); +insert t1 values(2); +create user u1@localhost; +grant select on mysqltest1.t1 to u1@localhost; +grant update on mysqltest1.* to u1@localhost; +update mysqltest1.t1 set id=1 where id=2; +drop user u1@localhost; +drop database mysqltest1; diff --git a/mysql-test/t/grant5.test b/mysql-test/t/grant5.test index 649bba7d1ca..74a69952124 100644 --- a/mysql-test/t/grant5.test +++ b/mysql-test/t/grant5.test @@ -20,6 +20,7 @@ show grants for foo; # role --error ER_DBACCESS_DENIED_ERROR show grants for foo@'%'; # user --connection default +--disconnect conn_1 drop user test, foo; drop role foo; @@ -33,3 +34,24 @@ REVOKE EXECUTE ON PROCEDURE sp FROM u; --error ER_TABLE_NOT_LOCKED REVOKE PROCESS ON *.* FROM u; DROP TABLE t1; + +# +# MDEV-23010 UPDATE privilege at Database and Table level fail to update with SELECT command denied to user +# +create database mysqltest1; +use mysqltest1; +create table t1(id int); +insert t1 values(2); +create user u1@localhost; +grant select on mysqltest1.t1 to u1@localhost; +grant update on mysqltest1.* to u1@localhost; +connect u1, localhost, u1; +update mysqltest1.t1 set id=1 where id=2; +connection default; +disconnect u1; +drop user u1@localhost; +drop database mysqltest1; + +# +# End of 10.1 tests +# diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index b2703dba76f..7925ec58852 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -7135,9 +7135,13 @@ static void check_grant_column_int(GRANT_TABLE *grant_table, const char *name, { if (grant_table) { - GRANT_COLUMN *grant_column= column_hash_search(grant_table, name, length); - if (grant_column) - *want_access&= ~grant_column->rights; + *want_access&= ~grant_table->privs; + if (*want_access & grant_table->cols) + { + GRANT_COLUMN *grant_column= column_hash_search(grant_table, name, length); + if (grant_column) + *want_access&= ~grant_column->rights; + } } } From 7e9ffc69ecd1bddf731391b01e6be221efb6f8ef Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Wed, 29 Jul 2020 23:26:09 +0300 Subject: [PATCH 25/35] MDEV-21472: ALTER TABLE ... ANALYZE PARTITION ... with EITS reads and locks all rows Do not collect EITS statistics for this statement: ALTER TABLE t ANALYZE PARTITION p EITS stats are currently global, not per-partition. Collecting global stats when we are asked to process just one partition causes issues for DBAs. --- mysql-test/r/stat_tables_partition.result | 34 ++++++++++++++++++++++- mysql-test/r/stat_tables_rbr.result | 1 - mysql-test/t/stat_tables_partition.test | 30 ++++++++++++++++++-- sql/sql_admin.cc | 10 +++++++ 4 files changed, 71 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/stat_tables_partition.result b/mysql-test/r/stat_tables_partition.result index 12ae2570272..2dd63e858d4 100644 --- a/mysql-test/r/stat_tables_partition.result +++ b/mysql-test/r/stat_tables_partition.result @@ -9,5 +9,37 @@ ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK -SET use_stat_tables = DEFAULT; DROP TABLE t1; +# +# MDEV-21472: ALTER TABLE ... ANALYZE PARTITION ... with EITS reads and locks all rows +# +CREATE TABLE t1 ( +id int(11) auto_increment primary key, +c1 int(11) DEFAULT NULL +) PARTITION BY RANGE (id) ( +PARTITION p0 VALUES LESS THAN (4), +PARTITION p1 VALUES LESS THAN MAXVALUE +); +insert into t1(c1) values (1),(1),(1),(1), (1),(1),(1),(1); +insert into t1(c1) select c1 from t1; +insert into t1(c1) select c1 from t1; +select count(*) from t1; +count(*) +32 +select count(*) from t1 where id <4; +count(*) +3 +flush status; +set session use_stat_tables='preferably'; +# Must NOT show "Engine-independent statistics collected": +alter table t1 analyze partition p0; +Table Op Msg_type Msg_text +test.t1 analyze status OK +# Should not have Handler_read_rnd_next=34 +show session status like 'Handler_read_rnd%'; +Variable_name Value +Handler_read_rnd 0 +Handler_read_rnd_deleted 0 +Handler_read_rnd_next 0 +drop table t1; +SET use_stat_tables = DEFAULT; diff --git a/mysql-test/r/stat_tables_rbr.result b/mysql-test/r/stat_tables_rbr.result index 35e74e29b08..83f8e3bb7c6 100644 --- a/mysql-test/r/stat_tables_rbr.result +++ b/mysql-test/r/stat_tables_rbr.result @@ -13,7 +13,6 @@ SET use_stat_tables = PREFERABLY; CREATE TABLE t1 ( a INT ) ENGINE=MyISAM PARTITION BY HASH(a) PARTITIONS 2; ALTER TABLE t1 ANALYZE PARTITION p1; Table Op Msg_type Msg_text -test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info diff --git a/mysql-test/t/stat_tables_partition.test b/mysql-test/t/stat_tables_partition.test index 1316e5cca11..11b74818d82 100644 --- a/mysql-test/t/stat_tables_partition.test +++ b/mysql-test/t/stat_tables_partition.test @@ -11,7 +11,33 @@ CREATE TABLE t1 (pk int PRIMARY KEY, a bit(1), INDEX idx(a) INSERT INTO t1 VALUES (1,1),(2,0),(3,0),(4,1); ANALYZE TABLE t1; +DROP TABLE t1; + +--echo # +--echo # MDEV-21472: ALTER TABLE ... ANALYZE PARTITION ... with EITS reads and locks all rows +--echo # +CREATE TABLE t1 ( + id int(11) auto_increment primary key, + c1 int(11) DEFAULT NULL +) PARTITION BY RANGE (id) ( + PARTITION p0 VALUES LESS THAN (4), + PARTITION p1 VALUES LESS THAN MAXVALUE +); + +insert into t1(c1) values (1),(1),(1),(1), (1),(1),(1),(1); +insert into t1(c1) select c1 from t1; +insert into t1(c1) select c1 from t1; + +select count(*) from t1; +select count(*) from t1 where id <4; +flush status; +set session use_stat_tables='preferably'; + +--echo # Must NOT show "Engine-independent statistics collected": +alter table t1 analyze partition p0; + +--echo # Should not have Handler_read_rnd_next=34 +show session status like 'Handler_read_rnd%'; +drop table t1; SET use_stat_tables = DEFAULT; - -DROP TABLE t1; diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 4afaff58223..beecf3fae64 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -727,8 +727,18 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, { compl_result_code= result_code= HA_ADMIN_INVALID; } + + /* + The check for Alter_info::ALTER_ADMIN_PARTITION implements this logic: + do not collect EITS STATS for this syntax: + ALTER TABLE ... ANALYZE PARTITION p + EITS statistics is global (not per-partition). Collecting global stats + is much more expensive processing just one partition, so the most + appropriate action is to just not collect EITS stats for this command. + */ collect_eis= (table->table->s->table_category == TABLE_CATEGORY_USER && + !(lex->alter_info.flags &= Alter_info::ALTER_ADMIN_PARTITION) && (get_use_stat_tables_mode(thd) > NEVER || lex->with_persistent_for_clause)); From 4860fe244bd1f4a6f3b803648d651e49e7b92a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 30 Jul 2020 11:01:16 +0300 Subject: [PATCH 26/35] XtraDB 5.6.49-89.0 The only change between Percona XtraDB Server 5.6.48-88.0 and 5.6.49-89.0 (apart from the version number change) was percona/percona-server@25ec24092064c2ab95752705e592e0c038ec1111 which we had already addressed in commit 7c03edf2fe66855a8ce8f2575c3aaf66af975377 and commit c0fca2863bcbd7cd231f1aa747b4f8d999e3a00e. --- mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff | 2 +- mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff | 2 +- storage/xtradb/include/univ.i | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff index 6181b49aa12..c8a0250504e 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff @@ -1215,7 +1215,7 @@ VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL -GLOBAL_VALUE 5.6.49 -+GLOBAL_VALUE 5.6.48-88.0 ++GLOBAL_VALUE 5.6.49-89.0 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff index bb59709ef4f..af9060d7334 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff @@ -685,7 +685,7 @@ VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL -GLOBAL_VALUE 5.6.49 -+GLOBAL_VALUE 5.6.48-88.0 ++GLOBAL_VALUE 5.6.49-89.0 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i index c0849bf0e2d..61a8639691a 100644 --- a/storage/xtradb/include/univ.i +++ b/storage/xtradb/include/univ.i @@ -45,10 +45,10 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_MAJOR 5 #define INNODB_VERSION_MINOR 6 -#define INNODB_VERSION_BUGFIX 48 +#define INNODB_VERSION_BUGFIX 49 #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 88.0 +#define PERCONA_INNODB_VERSION 89.0 #endif /* Enable UNIV_LOG_ARCHIVE in XtraDB */ From 4635218cb07ee15244c7a6bbcf6eeeeb7cec7fcf Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 30 Jul 2020 10:01:49 +0200 Subject: [PATCH 27/35] MDEV-22521 Server crashes in traverse_role_graph_up or Assertion `user' fails in traverse_role_graph_impl --- mysql-test/suite/roles/drop_current_role.result | 5 +++++ mysql-test/suite/roles/drop_current_role.test | 9 +++++++++ sql/sql_acl.cc | 2 ++ 3 files changed, 16 insertions(+) create mode 100644 mysql-test/suite/roles/drop_current_role.result create mode 100644 mysql-test/suite/roles/drop_current_role.test diff --git a/mysql-test/suite/roles/drop_current_role.result b/mysql-test/suite/roles/drop_current_role.result new file mode 100644 index 00000000000..79525a0ff50 --- /dev/null +++ b/mysql-test/suite/roles/drop_current_role.result @@ -0,0 +1,5 @@ +create role r; +set role r; +drop role r; +revoke all on *.* from current_role; +ERROR 42000: There is no such grant defined for user 'r' on host '' diff --git a/mysql-test/suite/roles/drop_current_role.test b/mysql-test/suite/roles/drop_current_role.test new file mode 100644 index 00000000000..1485b830eed --- /dev/null +++ b/mysql-test/suite/roles/drop_current_role.test @@ -0,0 +1,9 @@ +--source include/not_embedded.inc +# +# MDEV-22521 Server crashes in traverse_role_graph_up or Assertion `user' fails in traverse_role_graph_impl +# +create role r; +set role r; +drop role r; +error ER_NONEXISTING_GRANT; +revoke all on *.* from current_role; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 7925ec58852..fee337925fc 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -4977,6 +4977,8 @@ static void propagate_role_grants(ACL_ROLE *role, enum PRIVS_TO_MERGE::what what, const char *db= 0, const char *name= 0) { + if (!role) + return; mysql_mutex_assert_owner(&acl_cache->lock); PRIVS_TO_MERGE data= { what, db, name }; From 09ec8e2e2246f9fb67fd41631c5669d9ae26b2e5 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 30 Jul 2020 10:07:41 +0200 Subject: [PATCH 28/35] improve the error message for a dropped current role --- mysql-test/suite/roles/drop_current_role.result | 2 +- mysql-test/suite/roles/drop_current_role.test | 2 +- sql/sql_acl.cc | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/roles/drop_current_role.result b/mysql-test/suite/roles/drop_current_role.result index 79525a0ff50..d5eafc6c813 100644 --- a/mysql-test/suite/roles/drop_current_role.result +++ b/mysql-test/suite/roles/drop_current_role.result @@ -2,4 +2,4 @@ create role r; set role r; drop role r; revoke all on *.* from current_role; -ERROR 42000: There is no such grant defined for user 'r' on host '' +ERROR OP000: Invalid role specification `r`. diff --git a/mysql-test/suite/roles/drop_current_role.test b/mysql-test/suite/roles/drop_current_role.test index 1485b830eed..c8d6fc5d9df 100644 --- a/mysql-test/suite/roles/drop_current_role.test +++ b/mysql-test/suite/roles/drop_current_role.test @@ -5,5 +5,5 @@ create role r; set role r; drop role r; -error ER_NONEXISTING_GRANT; +error ER_INVALID_ROLE; revoke all on *.* from current_role; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index fee337925fc..cf0b1d87bd7 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3475,13 +3475,15 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER &combo, table->key_info->key_length); if (table->file->ha_index_read_idx_map(table->record[0], 0, user_key, - HA_WHOLE_KEY, - HA_READ_KEY_EXACT)) + HA_WHOLE_KEY, HA_READ_KEY_EXACT)) { /* what == 'N' means revoke */ if (what == 'N') { - my_error(ER_NONEXISTING_GRANT, MYF(0), combo.user.str, combo.host.str); + if (combo.host.length) + my_error(ER_NONEXISTING_GRANT, MYF(0), combo.user.str, combo.host.str); + else + my_error(ER_INVALID_ROLE, MYF(0), combo.user.str); goto end; } /* From 6e09e7c14beea4e55ccdbcd6c70ea18ddbf389d8 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Sun, 2 Aug 2020 11:18:30 +0200 Subject: [PATCH 29/35] C/C v3.1.9 --- libmariadb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmariadb b/libmariadb index ce74fd0c400..a746c3af449 160000 --- a/libmariadb +++ b/libmariadb @@ -1 +1 @@ -Subproject commit ce74fd0c4009ed9f4bcbdb4a01e96c823e961dc3 +Subproject commit a746c3af449a8754e78ad7971e59e79af7957cdb From db2a21733406fdd3314256216d0ce050d5399d94 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Sun, 2 Aug 2020 17:28:20 +0200 Subject: [PATCH 30/35] Fix for mac --- mysys/stacktrace.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c index b47afe522f0..a09bc91456c 100644 --- a/mysys/stacktrace.c +++ b/mysys/stacktrace.c @@ -42,13 +42,16 @@ extern char *__bss_start; #define PTR_SANE(p) (p) #endif /* __linux */ -#ifdef __linux__ void my_init_stacktrace() { +#ifdef __linux__ heap_start = (char*) &__bss_start; +#endif /* __linux */ } +#ifdef __linux__ + static void print_buffer(char *buffer, size_t count) { const char s[]= " "; From 7a4287d42170b4b901f973cf9b7da8a2f77998d1 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Sun, 2 Aug 2020 20:19:53 +0300 Subject: [PATCH 31/35] List of unstable tests for 10.1.46 release --- mysql-test/unstable-tests | 246 ++++++++++++++++++++------------------ 1 file changed, 129 insertions(+), 117 deletions(-) diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests index c7b95745198..a7eb0986bfc 100644 --- a/mysql-test/unstable-tests +++ b/mysql-test/unstable-tests @@ -23,35 +23,44 @@ # ############################################################################## # -# Based on 10.1 d233fd14a39f9c583b85ffb03e42b5ea52e2f4c2 +# Based on 10.1 09ec8e2e2246f9fb67fd41631c5669d9ae26b2e5 main.alter_table_trans : MDEV-12084 - timeout main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result main.auth_named_pipe : MDEV-14724 - System error 2 -main.connect_debug : Modified in 10.1.44 main.count_distinct2 : MDEV-11768 - timeout main.create_delayed : MDEV-10605 - failed with timeout main.create_drop_event : MDEV-16271 - Wrong result -main.ctype_utf16 : MDEV-10675: timeout or extra warnings +main.create_drop_function : Modified in 10.1.46 +main.ctype_binary : Modified in 10.1.46 +main.ctype_utf16 : MDEV-10675: timeout or extra warnings; modified in 10.1.46 +main.ctype_utf16le : Modified in 10.1.46 +main.ctype_utf32 : Modified in 10.1.46 +main.ctype_utf8 : Modified in 10.1.46 +main.ctype_utf8mb4 : Modified in 10.1.46 +main.ctype_utf8mb4_heap : Include file modified in 10.1.46 +main.ctype_utf8mb4_innodb : Include file modified in 10.1.46 +main.ctype_utf8mb4_myisam : Include file modified in 10.1.46 main.debug_sync : MDEV-10607 - internal error main.derived_opt : MDEV-11768 - timeout main.dirty_close : MDEV-19368 - mysqltest failed but provided no output main.events_2 : MDEV-13277 - Server crash -main.events_bugs : MDEV-12892 - Crash in fill_schema_processlist; modified in 10.1.44 +main.events_bugs : MDEV-12892 - Crash in fill_schema_processlist main.events_restart : MDEV-12236 - Server shutdown problem main.events_slowlog : MDEV-12821 - Wrong result main.flush : MDEV-19368 - mysqltest failed but provided no output main.func_gconcat : MDEV-21379 - Valgrind warnings -main.func_math : Modified in 10.1.45 -main.func_misc : Modified in 10.1.44 +main.func_math : Modified in 10.1.46 main.gis : MDEV-13411 - wrong result on P8 main.gis_notembedded : MDEV-21264 - Wrong result with different default charset +main.grant : Modified in 10.1.46 +main.grant5 : Modified in 10.1.46 main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown main.index_intersect_innodb : MDEV-10643 - failed with timeout -main.index_merge_innodb : MDEV-7142 - Wrong execution plan, timeout with valgrind +main.index_merge_innodb : MDEV-7142 - Wrong execution plan, timeout with valgrind; modified in 10.1.46 main.index_merge_myisam : Modified in 10.1.45 -main.innodb_mysql_lock : MDEV-7861 - sporadic lock detection failure (Fixed in 10.3+) -main.insert_debug : Added in 10.1.44 +main.information_schema : Modified in 10.1.46 +main.innodb_mysql_lock : MDEV-7861 - sporadic lock detection failure (Fixed in 10.3+, MDEV-22947) main.kill_processlist-6619 : MDEV-10793 - wrong result in processlist main.loaddata : MDEV-19368 - mysqltest failed but provided no output main.locale : MDEV-20521 - Wrong result (missing warning) @@ -70,31 +79,37 @@ main.mysqldump : Modified in 10.1.45 main.mysqlhotcopy_myisam : MDEV-10995 - test hangs on debug build main.mysqlslap : MDEV-11801 - timeout main.mysqltest : MDEV-9269 - fails on Alpha +main.nested_profiling : Added in 10.1.46 main.old-mode : MDEV-19373 - Wrong result -main.order_by : Modified in 10.1.44 +main.order_by : Modified in 10.1.46 main.order_by_optimizer_innodb : MDEV-10683 - wrong execution plan +main.partition : Modified in 10.1.46 main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock main.partition_innodb_plugin : MDEV-12901 - Valgrind warnings +main.processlist_notembedded : Modified in 10.1.46 main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count -main.query_cache : MDEV-12895 - Wrong result +main.query_cache : MDEV-12895 - Wrong result; modified in 10.1.46 main.query_cache_debug : MDEV-15281 - Resize or similar command in progress main.range : Modified in 10.1.45 main.range_innodb : Modified in 10.1.45 main.range_vs_index_merge_innodb : MDEV-15283 - Server has gone away -main.selectivity : Modified in 10.1.44 +main.selectivity : Modified in 10.1.46 main.set_statement : MDEV-13183 - Wrong result main.show_explain : MDEV-10674 - sporadic failure main.sp-security : MDEV-10607 - sporadic "can't connect" main.sp_notembedded : MDEV-10607 - internal error +main.stat_tables_innodb : Modified in 10.1.46 main.stat_tables_par_innodb : MDEV-14155 - wrong rounding +main.stat_tables_partition : Modified in 10.1.46 main.status : MDEV-8510 - sporadic wrong result +main.subselect4 : Modified in 10.1.46 +main.subselect_exists2in : Modified in 10.1.46 main.subselect_innodb : MDEV-10614 - sporadic wrong results main.tc_heuristic_recover : MDEV-15200 - wrong error on mysqld_stub_cmd main.type_blob : MDEV-15195 - Wrong result -main.type_datetime : Modified in 10.1.44 main.type_datetime_hires : MDEV-10687 - timeout -main.type_int : Modified in 10.1.44 -main.type_time : Modified in 10.1.44 +main.type_float : Modified in 10.1.46 +main.udf : Modified in 10.1.46 main.wait_timeout : Lost connection to MySQL server during query main.xa : MDEV-11769 - lock wait timeout @@ -111,21 +126,19 @@ archive-test_sql_discovery.discover : MDEV-16817 - Table marked as crashed #----------------------------------------------------------------------- -binlog.binlog_commit_wait : MDEV-10150 - Error: too much time elapsed -binlog.binlog_invalid_read_in_rotate : MDEV-22455 - Server crash; added in 10.1.44 -binlog.binlog_killed : MDEV-12925 - Wrong result -binlog.binlog_parallel_replication_marks_row : Include file modified in 10.1.44 -binlog.binlog_parallel_replication_marks_stm_mix : Include file modified in 10.1.44 -binlog.binlog_show_binlog_event_random_pos : Added in 10.1.44 -binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint -binlog.load_data_stm_view : MDEV-16948 - Wrong result +binlog.binlog_commit_wait : MDEV-10150 - Error: too much time elapsed +binlog.binlog_invalid_read_in_rotate : MDEV-22455 - Server crash +binlog.binlog_killed : MDEV-12925 - Wrong result +binlog.binlog_mysqlbinlog_row_frag : Modified in 10.1.46 +binlog.binlog_no_uniqfile_crash : Added in 10.1.46 +binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint +binlog.load_data_stm_view : MDEV-16948 - Wrong result #----------------------------------------------------------------------- binlog_encryption.binlog_xa_recover : MDEV-12908 - Extra checkpoint binlog_encryption.encrypted_master : MDEV-12906 - Failed to sync binlog_encryption.multisource : MDEV-21289 - Wrong error code -binlog_encryption.rpl_corruption : Include file modified in 10.1.44 binlog_encryption.rpl_parallel : MDEV-10653 - Timeout binlog_encryption.rpl_relayrotate : MDEV-15194 - Timeout binlog_encryption.rpl_semi_sync : MDEV-11220 - Wrong result, MDEV-11673 - Valgrind warning @@ -135,14 +148,8 @@ binlog_encryption.rpl_typeconv : MDEV-14362 - Lost connection to MySQ #----------------------------------------------------------------------- -connect.grant : Modified in 10.1.44 -connect.grant2 : Modified in 10.1.44 -connect.ini_grant : Modified in 10.1.44 -connect.mysql_grant : Modified in 10.1.44 -connect.pivot : MDEV-21378 - Valgrind warnings; MDEV-14803 - failed to discover table -connect.xml2_grant : Include file modified in 10.1.44 -connect.xml_grant : Include file modified in 10.1.44 -connect.zip : MDEV-13884 - Wrong result +connect.pivot : MDEV-21378 - Valgrind warnings; MDEV-14803 - failed to discover table +connect.zip : MDEV-13884 - Wrong result #----------------------------------------------------------------------- @@ -156,6 +163,7 @@ encryption.encrypt_and_grep : MDEV-13765 - Wrong result encryption.innodb-bad-key-change2 : MDEV-19118 - Can't connect through socket encryption.innodb-compressed-blob : MDEV-14728 - Unable to get certificate encryption.innodb-first-page-read : MDEV-14356 - Timeout on wait condition +encryption.innodb-missing-key : MDEV-17286 - SSL error encryption.innodb-page_encryption : MDEV-10641 - mutex problem encryption.innodb-read-only : MDEV-14728 - Unable to get certificate; MDEV-16563 - Crash on startup encryption.innodb-redo-badkey : MDEV-12898 - Server hang on startup @@ -219,7 +227,8 @@ galera_3nodes.* : The suite has not been stabilized yet innodb.binlog_consistent : MDEV-10618 - Server fails to start innodb.doublewrite : MDEV-12905 - Lost connection to MySQL server; MDEV-21380 - Assertion failure -innodb.foreign_key : Modified in 10.1.45 +innodb.foreign_key : Modified in 10.1.46 +innodb.foreign_key_debug : Added in 10.1.46 innodb.group_commit_crash : MDEV-11770 - Checksum mismatch innodb.group_commit_crash_no_optimize_thread : MDEV-11770 - Checksum mismatch innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup @@ -241,6 +250,7 @@ innodb.innodb_sys_semaphore_waits : MDEV-10331 - Wrong result innodb.innodb_sys_var_valgrind : Added in 10.1.45 innodb.innodb_zip_innochecksum2 : MDEV-13882 - Warning: difficult to find free blocks innodb.log_file_size : MDEV-15668 - Not found pattern +innodb.read_only_recover_committed : Modified in 10.1.46 innodb.recovery_shutdown : MDEV-15671 - Warning: database page corruption innodb.row_format_redundant : MDEV-15192 - Trying to access missing tablespace innodb.table_definition_cache_debug : MDEV-14206 - Extra warning @@ -249,13 +259,13 @@ innodb.xa_recovery : MDEV-15279 - mysqld got exception #----------------------------------------------------------------------- -innodb_fts.innodb_fts_misc : Modified in 10.1.44 innodb_fts.innodb_fts_misc_debug : MDEV-14156 - Unexpected warning innodb_fts.misc_debug2 : Added in 10.1.45 innodb_fts.stopword : Added in 10.1.45 #----------------------------------------------------------------------- +maria.encrypt-no-key : Added in 10.1.46 maria.insert_select : MDEV-12757 - Timeout maria.insert_select-7314 : MDEV-16492 - Timeout maria.maria : MDEV-14430 - Wrong result @@ -263,7 +273,8 @@ maria.maria : MDEV-14430 - Wrong result #----------------------------------------------------------------------- mariabackup.apply-log-only : MDEV-20135 - Timeout -mariabackup.huge_lsn : MDEV-17286 - SSL error +mariabackup.huge_lsn : MDEV-17286 - SSL error; modified in 10.1.46 +mariabackup.incremental_backup : MDEV-15667 - Timeout mariabackup.incremental_encrypted : MDEV-15667 - Timeout mariabackup.mdev-14447 : MDEV-15201 - Timeout mariabackup.xb_compressed_encrypted : MDEV-14812 - Segfault @@ -307,8 +318,6 @@ perfschema.connect_attrs : MDEV-17283 - Wrong result perfschema.func_file_io : MDEV-5708 - fails for s390x perfschema.func_mutex : MDEV-5708 - fails for s390x perfschema.hostcache_ipv6_ssl : MDEV-10696 - crash on shutdown -perfschema.hostcache_peer_addr : MDEV-21462 - Test condition timeout -perfschema.misc : Modified in 10.1.44 perfschema.privilege_table_io : MDEV-13184 - Extra lines perfschema.rpl_gtid_func : MDEV-16897 - Wrong result perfschema.socket_summary_by_event_name_func : MDEV-10622 - Socket summary tables do not match @@ -329,82 +338,86 @@ plugins.thread_pool_server_audit : MDEV-9562 - crashes on sol10-sparc #----------------------------------------------------------------------- -roles.create_and_grant_role : MDEV-11772 - wrong result +roles.create_and_grant_role : MDEV-11772 - wrong result +roles.drop_current_role : Added in 10.1.46 +roles.set_default_role_invalid : Modified in 10.1.46 #----------------------------------------------------------------------- -rpl.circular_serverid0 : MDEV-19372 - ASAN heap-use-after-free -rpl.create_or_replace_mix : MDEV-20523 - Wrong result -rpl.create_or_replace_statement : MDEV-20523 - Wrong result -rpl.create_select : MDEV-14121 - Assertion failure -rpl.last_insert_id : MDEV-10625 - warnings in error log -rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips -rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips -rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log -rpl.rpl_binlog_index : MDEV-9501 - Warning: failed registering on master -rpl.rpl_colSize : MDEV-16112 - Server crash -rpl.rpl_conditional_comments : Modified in 10.1.45 -rpl.rpl_corruption : Include file modified in 10.1.44 -rpl.rpl_ddl : MDEV-10417 - Fails on Mips -rpl.rpl_domain_id_filter_io_crash : MDEV-14357 - Wrong result -rpl.rpl_domain_id_filter_master_crash : MDEV-19043 - Warnings/errors -rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result; MDEV-19043 - Warnings/errors -rpl.rpl_drop_db_fail : MDEV-16898 - Slave fails to start -rpl.rpl_fail_register : Added in 10.1.45 -rpl.rpl_get_lock : MDEV-19368 - mysqltest failed but provided no output -rpl.rpl_gtid_basic : MDEV-10681 - server startup problem -rpl.rpl_gtid_crash : MDEV-9501 - Warning: failed registering on master -rpl.rpl_gtid_delete_domain : MDEV-14463 - Timeout in include -rpl.rpl_gtid_mdev9033 : MDEV-10680 - warnings -rpl.rpl_gtid_reconnect : MDEV-14497 - Timeout -rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown, MDEV-12629 - Valgrind warnings -rpl.rpl_gtid_until : MDEV-10625 - warnings in error log -rpl.rpl_innodb_bug30888 : MDEV-10417 - Fails on Mips -rpl.rpl_insert : MDEV-9329 - Fails on Ubuntu/s390x -rpl.rpl_insert_delayed : MDEV-9329 - Fails on Ubuntu/s390x -rpl.rpl_insert_id : MDEV-15197 - Wrong result -rpl.rpl_insert_id_pk : MDEV-16567 - Assertion failure -rpl.rpl_insert_ignore : MDEV-14365 - Lost connection to MySQL server during query -rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips -rpl.rpl_mariadb_slave_capability : MDEV-11018 - sporadic wrong events in binlog -rpl.rpl_mdev12179 : MDEV-19043 - Warnings/errors -rpl.rpl_mdev6020 : MDEV-10417 - Fails on Mips -rpl.rpl_non_direct_row_mixing_engines : MDEV-16561 - Timeout in master pos wait -rpl.rpl_parallel : MDEV-10653 - Timeouts -rpl.rpl_parallel_mdev6589 : MDEV-12979 - Assertion failure -rpl.rpl_parallel_multilevel2 : MDEV-14723 - Timeout -rpl.rpl_parallel_optimistic : MDEV-10511 - Timeout -rpl.rpl_parallel_retry : MDEV-11119 - Server crash -rpl.rpl_parallel_temptable : MDEV-10356 - Crash in close_thread_tables -rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips -rpl.rpl_password_boundaries : MDEV-11534 - Slave IO warnings -rpl.rpl_row_basic_11bugs : MDEV-12171 - Server failed to start -rpl.rpl_row_basic_2myisam : MDEV-13875 - command "diff_files" failed -rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result -rpl.rpl_row_img_blobs : MDEV-13875 - command "diff_files" failed -rpl.rpl_row_img_eng_min : MDEV-13875 - command "diff_files" failed -rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed -rpl.rpl_row_index_choice : MDEV-15196 - Slave crash -rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x -rpl.rpl_semi_sync : MDEV-11220 - Wrong result -rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result -rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result -rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings -rpl.rpl_semi_sync_gtid_reconnect : Added in 10.1.44 -rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Wrong plugin status -rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition -rpl.rpl_show_slave_hosts : MDEV-10681 - server startup problem -rpl.rpl_skip_replication : MDEV-9268 - Fails with timeout in sync_slave_with_master on Alpha -rpl.rpl_slave_grp_exec : MDEV-10514 - Unexpected deadlock -rpl.rpl_start_stop_slave : MDEV-13567 - Replication failure -rpl.rpl_stm_relay_ign_space : MDEV-14360 - Test assertion -rpl.rpl_sync : MDEV-10633 - Database page corruption -rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries -rpl.rpl_test_framework : MDEV-19368 - mysqltest failed but provided no output -rpl.rpl_trigger : MDEV-18055 - Wrong result -rpl.rpl_truncate_3innodb : MDEV-19454 - Syntax error in test -rpl.rpl_user_variables : MDEV-20522 - Wrong result -rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result +rpl.circular_serverid0 : MDEV-19372 - ASAN heap-use-after-free +rpl.create_or_replace_mix : MDEV-20523 - Wrong result +rpl.create_or_replace_statement : MDEV-20523 - Wrong result +rpl.create_select : MDEV-14121 - Assertion failure +rpl.last_insert_id : MDEV-10625 - warnings in error log +rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips +rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips +rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log +rpl.rpl_binlog_dump_slave_gtid_state_info : Added in 10.1.46 +rpl.rpl_binlog_index : MDEV-9501 - Warning: failed registering on master +rpl.rpl_checksum_cache : MDEV-22510 - Server crash +rpl.rpl_colSize : MDEV-16112 - Server crash +rpl.rpl_conditional_comments : Modified in 10.1.45 +rpl.rpl_ddl : MDEV-10417 - Fails on Mips +rpl.rpl_domain_id_filter_io_crash : MDEV-14357 - Wrong result +rpl.rpl_domain_id_filter_master_crash : MDEV-19043 - Warnings/errors +rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result; MDEV-19043 - Warnings/errors +rpl.rpl_drop_db_fail : MDEV-16898 - Slave fails to start +rpl.rpl_fail_register : Modified in 10.1.46 +rpl.rpl_get_lock : MDEV-19368 - mysqltest failed but provided no output +rpl.rpl_gtid_basic : MDEV-10681 - server startup problem +rpl.rpl_gtid_crash : MDEV-9501 - Warning: failed registering on master +rpl.rpl_gtid_delete_domain : MDEV-14463 - Timeout in include +rpl.rpl_gtid_mdev9033 : MDEV-10680 - warnings +rpl.rpl_gtid_reconnect : MDEV-14497 - Timeout +rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown, MDEV-12629 - Valgrind warnings +rpl.rpl_gtid_until : MDEV-10625 - warnings in error log +rpl.rpl_innodb_bug30888 : MDEV-10417 - Fails on Mips +rpl.rpl_insert : MDEV-9329 - Fails on Ubuntu/s390x +rpl.rpl_insert_delayed : MDEV-9329 - Fails on Ubuntu/s390x +rpl.rpl_insert_id : MDEV-15197 - Wrong result +rpl.rpl_insert_id_pk : MDEV-16567 - Assertion failure +rpl.rpl_insert_ignore : MDEV-14365 - Lost connection to MySQL server during query +rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips +rpl.rpl_mariadb_slave_capability : MDEV-11018 - sporadic wrong events in binlog +rpl.rpl_mdev12179 : MDEV-19043 - Warnings/errors +rpl.rpl_mdev6020 : MDEV-10417 - Fails on Mips +rpl.rpl_non_direct_row_mixing_engines : MDEV-16561 - Timeout in master pos wait +rpl.rpl_parallel : MDEV-10653 - Timeouts +rpl.rpl_parallel2 : MDEV-23089 - Server hang +rpl.rpl_parallel_mdev6589 : MDEV-12979 - Assertion failure +rpl.rpl_parallel_multilevel2 : MDEV-14723 - Timeout +rpl.rpl_parallel_optimistic : MDEV-10511 - Timeout +rpl.rpl_parallel_optimistic_until : Added in 10.1.46 +rpl.rpl_parallel_retry : MDEV-11119 - Server crash +rpl.rpl_parallel_temptable : MDEV-10356 - Crash in close_thread_tables +rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips +rpl.rpl_password_boundaries : MDEV-11534 - Slave IO warnings +rpl.rpl_row_basic_11bugs : MDEV-12171 - Server failed to start +rpl.rpl_row_basic_2myisam : MDEV-13875 - command "diff_files" failed +rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result +rpl.rpl_row_img_blobs : MDEV-13875 - command "diff_files" failed +rpl.rpl_row_img_eng_min : MDEV-13875 - command "diff_files" failed +rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed +rpl.rpl_row_index_choice : MDEV-15196 - Slave crash +rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x +rpl.rpl_semi_sync : MDEV-11220 - Wrong result +rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result +rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result +rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings +rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Wrong plugin status +rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition +rpl.rpl_show_slave_hosts : MDEV-10681 - server startup problem +rpl.rpl_skip_replication : MDEV-9268 - Fails with timeout in sync_slave_with_master on Alpha +rpl.rpl_slave_grp_exec : MDEV-10514 - Unexpected deadlock +rpl.rpl_start_stop_slave : MDEV-13567 - Replication failure +rpl.rpl_stm_relay_ign_space : MDEV-14360 - Test assertion +rpl.rpl_sync : MDEV-10633 - Database page corruption +rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries +rpl.rpl_test_framework : MDEV-19368 - mysqltest failed but provided no output +rpl.rpl_trigger : MDEV-18055 - Wrong result +rpl.rpl_truncate_3innodb : MDEV-19454 - Syntax error in test +rpl.rpl_user_variables : MDEV-20522 - Wrong result +rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result #----------------------------------------------------------------------- @@ -450,6 +463,7 @@ stress.ddl_innodb : MDEV-10635 - Testcase timeout sys_vars.autocommit_func2 : MDEV-9329 - Fails on Ubuntu/s390x sys_vars.keep_files_on_create_basic : MDEV-10676 - timeout sys_vars.log_slow_admin_statements_func : MDEV-12235 - Server crash +sys_vars.max_sort_length_basic : Modified in 10.1.46 sys_vars.rpl_init_slave_func : MDEV-10149 - wrong results sys_vars.thread_cache_size_func : MDEV-11775 - Wrong result sys_vars.wait_timeout_func : MDEV-12896 - Wrong result @@ -506,16 +520,14 @@ unit.ma_test_loghandler : MDEV-10638 - record read not ok vcol.not_supported : MDEV-10639 - Testcase timeout vcol.vcol_keys_innodb : MDEV-10639 - Testcase timeout -vcol.vcol_misc : MDEV-16651 - Wrong error message +vcol.vcol_misc : MDEV-16651 - Wrong error message; modified in 10.1.46 #----------------------------------------------------------------------- -wsrep.foreign_key : MDEV-14725 - WSREP has not yet prepared node -wsrep.mdev_6832 : MDEV-14195 - Failure upon check-testcase -wsrep.mysql_tzinfo_to_sql_symlink : Modified in 10.1.44 -wsrep.mysql_tzinfo_to_sql_symlink_skip : Modified in 10.1.44 -wsrep.pool_of_threads : MDEV-17345 - WSREP has not yet prepared node for application use -wsrep.variables : MDEV-17585 - Deadlock +wsrep.foreign_key : MDEV-14725 - WSREP has not yet prepared node +wsrep.mdev_6832 : MDEV-14195 - Failure upon check-testcase +wsrep.pool_of_threads : MDEV-17345 - WSREP has not yet prepared node for application use +wsrep.variables : MDEV-17585 - Deadlock #----------------------------------------------------------------------- From dbb4572fe95bbf7f32949d6ab9228f4891e2f147 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Mon, 3 Aug 2020 02:42:07 +0300 Subject: [PATCH 32/35] MDEV-23375 parts.partition_debug fails when it's run after another test Make sure system tables aren't open, as the test kills the server --- mysql-test/suite/parts/r/partition_debug.result | 1 + mysql-test/suite/parts/t/partition_debug.test | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/mysql-test/suite/parts/r/partition_debug.result b/mysql-test/suite/parts/r/partition_debug.result index d0efd9d7c2a..0a8b8d20520 100644 --- a/mysql-test/suite/parts/r/partition_debug.result +++ b/mysql-test/suite/parts/r/partition_debug.result @@ -1,3 +1,4 @@ +FLUSH TABLES; # # Bug#13737949: CRASH IN HA_PARTITION::INDEX_INIT # Bug#18694052: SERVER CRASH IN HA_PARTITION::INIT_RECORD_PRIORITY_QUEUE diff --git a/mysql-test/suite/parts/t/partition_debug.test b/mysql-test/suite/parts/t/partition_debug.test index ef12ee99948..183a9b750d6 100644 --- a/mysql-test/suite/parts/t/partition_debug.test +++ b/mysql-test/suite/parts/t/partition_debug.test @@ -8,6 +8,10 @@ # Crash tests don't work with embedded --source include/not_embedded.inc +# Make sure system tables are not open, as the test will kill the server +# and it will cause corruption errors in the log +FLUSH TABLES; + # Partitioning test that require debug features --echo # From dc716da4571465af3adadcd2c471f11fef3a2191 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Mon, 3 Aug 2020 03:34:57 +0300 Subject: [PATCH 33/35] List of unstable tests for 10.2.33 release --- mysql-test/unstable-tests | 587 +++++++++++++++++--------------------- 1 file changed, 265 insertions(+), 322 deletions(-) diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests index b79b23bb098..6bffc3cc195 100644 --- a/mysql-test/unstable-tests +++ b/mysql-test/unstable-tests @@ -23,131 +23,143 @@ # ############################################################################## # -# Based on bb-10.2-release 1cccd3c7cc1a5a973e03f9dd8dc457bce554d7a9 +# Based on bb-10.2-release 9c84b80f8403f7cdbe41170850bc94b60239e2f6 +# Mon Aug 3 02:57:50 2020 +0300 +# Merge branch '10.1' into 10.2 main.alter_table_trans : MDEV-12084 - timeout main.alter_user : Modified in 10.2.32 main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result main.auth_named_pipe : MDEV-14724 - System error 2 -main.cache_temporal_4265 : Modified in 10.2.31 +main.comment_table : Modified in 10.2.33 main.connect : MDEV-17282 - Wrong result main.connect2 : MDEV-13885 - Server crash -main.connect_debug : Modified in 10.2.31 main.count_distinct2 : MDEV-11768 - timeout main.create_delayed : MDEV-10605 - failed with timeout main.create_drop_event : MDEV-16271 - Wrong result -main.create_or_replace2 : Modified in 10.2.31 -main.cte_nonrecursive : Modified in 10.2.31 +main.create_drop_function : Modified in 10.2.33 +main.cte_recursive : Modified in 10.2.33 +main.ctype_binary : Modified in 10.2.33 main.ctype_ucs : MDEV-17681 - Data too long for column main.ctype_upgrade : MDEV-16945 - Error upon mysql_upgrade -main.ctype_utf16 : MDEV-10675: timeout or extra warnings +main.ctype_utf16 : MDEV-10675: timeout or extra warnings; modified in 10.2.33 +main.ctype_utf16_uca : Modified in 10.2.33 +main.ctype_utf16le : Modified in 10.2.33 +main.ctype_utf32 : Modified in 10.2.33 +main.ctype_utf8 : Modified in 10.2.33 +main.ctype_utf8mb4 : Modified in 10.2.33 +main.ctype_utf8mb4_heap : Include file modified in 10.2.33 +main.ctype_utf8mb4_innodb : Include file modified in 10.2.33 +main.ctype_utf8mb4_myisam : Include file modified in 10.2.33 main.debug_sync : MDEV-10607 - internal error -main.default_session : Modified in 10.2.31 main.derived_cond_pushdown : Modified in 10.2.32 main.derived_opt : MDEV-11768 - timeout main.dirty_close : MDEV-19368 - mysqltest failed but provided no output main.distinct : MDEV-14194 - Crash -main.drop_bad_db_type : MDEV-15676 - Wrong result; modified in 10.2.31 -main.engine_error_in_alter-8453 : Modified in 10.2.31 -main.error_simulation : Modified in 10.2.31 +main.drop_bad_db_type : MDEV-15676 - Wrong result main.errors : Modified in 10.2.32 main.events_2 : MDEV-13277 - Crash -main.events_bugs : MDEV-12892 - Crash; modified in 10.2.31 +main.events_bugs : MDEV-12892 - Crash main.events_restart : MDEV-12236 - Server shutdown problem; modified in 10.2.32 main.events_slowlog : MDEV-12821 - Wrong result main.flush : MDEV-19368 - mysqltest failed but provided no output -main.foreign_key : Modified in 10.2.31 main.fulltext : Modified in 10.2.32 -main.func_math : Modified in 10.2.32 -main.func_misc : Modified in 10.2.31 -main.func_regexp_pcre : Modified in 10.2.31 -main.func_regexp_pcre_debug : Modified in 10.2.31 -main.func_time : Modified in 10.2.31 +main.func_gconcat : MDEV-21379 - Valgrind warnings +main.func_json : Modified in 10.2.33 +main.func_math : Modified in 10.2.33 main.gis : MDEV-13411 - wrong result on P8; modified in 10.2.32 main.gis-rtree : Modified in 10.2.32 main.gis_notembedded : MDEV-21264 - Wrong result with different default charset +main.grant : Modified in 10.2.33 +main.grant5 : Modified in 10.2.33 main.group_by : Modified in 10.2.32 main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown main.index_intersect_innodb : MDEV-10643 - failed with timeout -main.index_merge_innodb : MDEV-7142 - Plan mismatch +main.index_merge_innodb : MDEV-7142 - Plan mismatch; modified in 10.2.33 main.index_merge_myisam : Modified in 10.2.32 -main.innodb_mysql_lock : MDEV-7861 - Wrong result (Fixed in 10.3+) -main.insert_debug : Added in 10.2.31 +main.information_schema : Modified in 10.2.33 +main.innodb_mrr_cpk : MDEV-23370 - Server crash +main.innodb_mysql_lock : MDEV-7861 - sporadic lock detection failure (Fixed in 10.3+, MDEV-22947) main.kill-2 : MDEV-13257 - Wrong result main.kill_processlist-6619 : MDEV-10793 - Wrong result main.loaddata : MDEV-19368 - mysqltest failed but provided no output main.locale : MDEV-20521 - Missing warning; configuration added in 10.2.32 +main.lock : Modified in 10.2.33 main.log_slow : MDEV-13263 - Wrong result -main.log_slow_debug : Modified in 10.2.31 +main.log_tables : Modified in 10.2.33 main.log_tables-big : MDEV-13408 - wrong result main.mdev-504 : MDEV-15171 - warning main.mdev375 : MDEV-10607 - sporadic "can't connect"; modified in 10.2.32 -main.mdev6830 : Modified in 10.2.31 main.merge : MDEV-10607 - sporadic "can't connect" -main.merge-big : Modified in 10.2.31 -main.merge_debug : Modified in 10.2.31 main.multi_update_debug : Modified in 10.2.32 -main.myisam_debug : Modified in 10.2.31 main.mysql_client_test : MDEV-19369 - error: 5888, status: 23, errno: 2; modified in 10.2.32 main.mysql_client_test_comp : MDEV-16641 - Error in exec main.mysql_client_test_nonblock : CONC-208 - Error on Power; MDEV-15096 - exec failed main.mysql_upgrade_noengine : MDEV-14355 - Wrong result main.mysqld--defaults-file : Modified in 10.2.32 main.mysqld_option_err : MDEV-21571 - Crash on bootstrap -main.mysqldump : MDEV-22147 - Wrong result; MDEV-14800 - Stack smashing detected; modified in 10.2.32 +main.mysqldump : MDEV-14800 - Stack smashing detected; modified in 10.2.32 main.mysqlhotcopy_myisam : MDEV-10995 - Hang on debug main.mysqlslap : MDEV-11801 - timeout main.mysqltest : MDEV-9269 - fails on Alpha; MDEV-13887 - Wrong result +main.mysqltest_tracking_info : Modified in 10.2.33 +main.nested_profiling : Added in 10.2.33 main.old-mode : MDEV-19373 - Wrong result main.openssl_6975 : MDEV-17184 - Failures with OpenSSL 1.1.1 +main.order_by : Modified in 10.2.33 main.order_by_optimizer_innodb : MDEV-10683 - Wrong result +main.parser : Modified in 10.2.33 +main.partition : Modified in 10.2.33 +main.partition_alter : Modified in 10.2.33 main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock -main.partition_innodb : Modified in 10.2.32 +main.partition_innodb : MDEV-23370 - Server crash; modified in 10.2.32 main.partition_innodb_plugin : MDEV-12901 - Valgrind warnings main.partition_innodb_semi_consistent : MDEV-19411 - Failed to start mysqld.1 -main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count -main.query_cache : MDEV-16180 - Wrong result +main.plugin : Modified in 10.2.33 +main.processlist_notembedded : Modified in 10.2.33 +main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count; modified in 10.2.33 +main.query_cache : MDEV-16180 - Wrong result; modified in 10.2.33 main.query_cache_debug : MDEV-15281 - Query cache is disabled main.range : Modified in 10.2.32 -main.range_innodb : Modified in 10.2.32 -main.range_interrupted-13751 : Modified in 10.2.31 +main.range_innodb : MDEV-23371 - Server crash; modified in 10.2.32 main.range_vs_index_merge_innodb : MDEV-15283 - Server has gone away +main.repair : Modified in 10.2.33 main.rpl_mysql_upgrade_slave_repo_check : Added in 10.2.32 -main.select_debug : Modified in 10.2.31 +main.selectivity : Modified in 10.2.33 main.set_statement : MDEV-13183 - Wrong result main.set_statement_notembedded : MDEV-19414 - Wrong result main.shm : MDEV-12727 - Mismatch, ERROR 2013 -main.show_explain : MDEV-10674 - Wrong result code; modified in 10.2.31 -main.show_explain_non_select : Modified in 10.2.31 -main.show_explain_ps : Modified in 10.2.31 -main.slowlog_enospace-10508 : Modified in 10.2.31 +main.show_explain : MDEV-10674 - Wrong result code +main.sp-error : Modified in 10.2.33 main.sp-security : MDEV-10607 - sporadic "can't connect" +main.sp2 : Added in 10.2.33 main.sp_notembedded : MDEV-10607 - internal error main.ssl : MDEV-17184 - Failures with OpenSSL 1.1.1 -main.ssl_7937 : Modified in 10.2.31 -main.ssl_8k_key : Modified in 10.2.31 main.ssl_ca : MDEV-10895 - SSL connection error on Power main.ssl_cipher : MDEV-17184 - Failures with OpenSSL 1.1.1 -main.ssl_crl : MDEV-19119 - Wrong error code -main.ssl_crl_clients : Modified in 10.2.31 -main.ssl_system_ca : Added in 10.2.31 +main.ssl_crl : Modified in 10.2.33 main.ssl_timeout : MDEV-11244 - Crash -main.stat_tables-enospc : Modified in 10.2.31 -main.stat_tables_par : MDEV-13266 - Wrong result +main.stat_tables_innodb : Modified in 10.2.33 main.stat_tables_par_innodb : MDEV-14155 - Wrong rounding +main.stat_tables_partition : Modified in 10.2.33 main.status : MDEV-13255 - Wrong result +main.subselect4 : Modified in 10.2.33 +main.subselect_exists2in : Modified in 10.2.33 main.subselect_innodb : MDEV-10614 - Sporadic wrong results main.tc_heuristic_recover : MDEV-14189 - Wrong result +main.temp_table : Modified in 10.2.33 main.type_blob : MDEV-15195 - Wrong result -main.type_datetime : Modified in 10.2.31 +main.type_date : Modified in 10.2.33 +main.type_datetime : Modified in 10.2.33 main.type_datetime_hires : MDEV-10687 - Timeout -main.type_int : Modified in 10.2.31 -main.type_time : Modified in 10.2.31 -main.union_crash-714 : Modified in 10.2.31 +main.type_float : Modified in 10.2.33 +main.type_time : Modified in 10.2.33 +main.udf : Modified in 10.2.33 +main.union : Modified in 10.2.33 main.userstat : MDEV-12904 - SSL errors main.wait_timeout : MDEV-19023 - Lost connection to MySQL server during query -main.warnings_debug : Modified in 10.2.31 -main.win : Modified in 10.2.31 +main.win : Modified in 10.2.33 +main.win_ntile : Modified in 10.2.33 main.xa : MDEV-11769 - lock wait timeout #----------------------------------------------------------------------- @@ -163,45 +175,36 @@ archive-test_sql_discovery.discover : MDEV-16817 - Table marked as crashed #----------------------------------------------------------------------- -binlog.binlog_commit_wait : MDEV-10150 - Mismatch -binlog.binlog_index : Include file modified in 10.2.31 -binlog.binlog_invalid_read_in_rotate : MDEV-22455 - Server crash; added in 10.2.31 -binlog.binlog_ioerr : Include file modified in 10.2.31 -binlog.binlog_killed : MDEV-12925 - Wrong result -binlog.binlog_max_extension : MDEV-19762 - Crash on shutdown -binlog.binlog_parallel_replication_marks_row : Include file modified in 10.2.31 -binlog.binlog_parallel_replication_marks_stm_mix : Include file modified in 10.2.31 -binlog.binlog_show_binlog_event_random_pos : Added in 10.2.31 -binlog.binlog_write_error : Include file Include file modified in 10.2.31 -binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint -binlog.flashback-largebinlog : MDEV-19764 - Out of memory -binlog.load_data_stm_view : MDEV-16948 - Wrong result +binlog.binlog_commit_wait : MDEV-10150 - Mismatch +binlog.binlog_invalid_read_in_rotate : MDEV-22455 - Server crash +binlog.binlog_killed : MDEV-12925 - Wrong result +binlog.binlog_max_extension : MDEV-19762 - Crash on shutdown +binlog.binlog_mysqlbinlog_row_frag : Modified in 10.2.33 +binlog.binlog_no_uniqfile_crash : Added in 10.2.33 +binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint +binlog.flashback-largebinlog : MDEV-19764 - Out of memory +binlog.load_data_stm_view : MDEV-16948 - Wrong result #----------------------------------------------------------------------- -binlog_encryption.binlog_index : Include file modified in 10.2.31 -binlog_encryption.binlog_ioerr : Include file modified in 10.2.31 -binlog_encryption.binlog_write_error : Include file Include file modified in 10.2.31 binlog_encryption.binlog_xa_recover : MDEV-12908 - Extra checkpoint binlog_encryption.encrypted_master : MDEV-14201 - Extra warnings binlog_encryption.encrypted_master_switch_to_unencrypted : MDEV-14190 - Can't init tc log binlog_encryption.encryption_combo : MDEV-14199 - Table is marked as crashed binlog_encryption.multisource : MDEV-21289 - Wrong error code binlog_encryption.rpl_binlog_errors : MDEV-12742 - Crash; include file modified in 10.2.32 -binlog_encryption.rpl_checksum : MDEV-16951 - Wrong result; include file modified in 10.2.31 +binlog_encryption.rpl_checksum : MDEV-16951 - Wrong result binlog_encryption.rpl_corruption : Include file modified in 10.2.32 binlog_encryption.rpl_gtid_basic : MDEV-16947 - Server failed to start -binlog_encryption.rpl_incident : MDEV-21569 - mutex: LOCK_global_system_variables unlocking; include file modified in 10.2.31 -binlog_encryption.rpl_init_slave_errors : Include file modified in 10.2.31 +binlog_encryption.rpl_incident : MDEV-21569 - mutex: LOCK_global_system_variables unlocking binlog_encryption.rpl_loadfile : MDEV-16645 - Timeout in include -binlog_encryption.rpl_parallel : MDEV-10653 - Timeout in include; include file modified in 10.2.31 -binlog_encryption.rpl_parallel_ignored_errors : MDEV-22471 - Slave crash; include file modified in 10.2.31 +binlog_encryption.rpl_parallel : MDEV-10653 - Timeout in include +binlog_encryption.rpl_parallel_ignored_errors : MDEV-22471 - Slave crash binlog_encryption.rpl_relayrotate : MDEV-15194 - Timeout binlog_encryption.rpl_semi_sync : MDEV-11673 - Valgrind binlog_encryption.rpl_skip_replication : MDEV-13571 - Unexpected warning binlog_encryption.rpl_ssl : MDEV-14507 - Timeouts binlog_encryption.rpl_stm_relay_ign_space : MDEV-19375 - Wrong result (test assertion) -binlog_encryption.rpl_sync : MDEV-13830 - Assertion failure binlog_encryption.rpl_typeconv : MDEV-14362 - Lost connection to MySQL server during query #----------------------------------------------------------------------- @@ -226,6 +229,7 @@ encryption.innodb-discard-import : MDEV-19113 - Timeout encryption.innodb-encryption-alter : MDEV-13566 - Lock wait timeout encryption.innodb-first-page-read : MDEV-14356 - Timeout in wait condition encryption.innodb-force-corrupt : MDEV-17286 - SSL error +encryption.innodb-missing-key : MDEV-17286 - SSL error encryption.innodb-page_encryption : MDEV-10641 - mutex problem encryption.innodb-read-only : MDEV-16563 - Crash on startup encryption.innodb-redo-badkey : MDEV-12898 - Server hang on startup @@ -234,7 +238,7 @@ encryption.innodb-spatial-index : MDEV-13746 - Wrong result encryption.innodb_encrypt_key_rotation_age : MDEV-19763 - Timeout encryption.innodb_encrypt_log : MDEV-13725 - Wrong result encryption.innodb_encrypt_log_corruption : MDEV-14379 - Server crash -encryption.innodb_encrypt_temporary_tables : MDEV-20142 - Wrong result +encryption.innodb_encrypt_temporary_tables : MDEV-20142 - Wrong result; modified in 10.2.33 encryption.innodb_encryption : MDEV-14728 - Unable to get certificate; MDEV-15675 - Timeout encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure encryption.innodb_encryption_discard_import : MDEV-16116 - Wrong result @@ -242,9 +246,9 @@ encryption.innodb_encryption_is : MDEV-12898 - Server hang on star encryption.innodb_encryption_row_compressed : MDEV-16113 - Crash encryption.innodb_first_page : MDEV-10689 - Crash encryption.innodb_onlinealter_encryption : MDEV-17287 - SIGABRT on server restart -encryption.innodb_scrub : MDEV-8139 - scrubbing tests need fixing -encryption.innodb_scrub_background : MDEV-8139 - scrubbing tests need fixing -encryption.innodb_scrub_compressed : MDEV-8139 - scrubbing tests need fixing +encryption.innodb_scrub : MDEV-8139 - scrubbing tests need fixing (Fixed in 10.5+) +encryption.innodb_scrub_background : MDEV-8139 - scrubbing tests need fixing (Fixed in 10.5+) +encryption.innodb_scrub_compressed : MDEV-8139 - scrubbing tests need fixing (Fixed in 10.5+) #----------------------------------------------------------------------- @@ -269,7 +273,6 @@ federated.federatedx : MDEV-10617 - Wrong checksum #----------------------------------------------------------------------- -funcs_1.is_check_constraints : Modified in 10.2.31 funcs_1.memory_views : MDEV-11773 - timeout funcs_1.processlist_val_no_prot : MDEV-11223 - Wrong result funcs_1.processlist_val_ps : MDEV-12175 - Wrong plan @@ -293,10 +296,9 @@ galera_3nodes.* : Suite is not stable yet #----------------------------------------------------------------------- -gcol.gcol_rollback : MDEV-16954 - Unknown storage engine 'InnoDB' +gcol.gcol_bugfixes : Modified in 10.2.33 gcol.innodb_virtual_basic : MDEV-16950 - Failing assertion -gcol.innodb_virtual_debug : MDEV-19114 - Assertion failure -gcol.innodb_virtual_debug_purge : MDEV-16952 - Wrong result; modified in 10.2.32 +gcol.innodb_virtual_debug_purge : MDEV-16952 - Wrong result; modified in 10.2.33 #----------------------------------------------------------------------- @@ -304,18 +306,18 @@ innodb.101_compatibility : MDEV-13891 - Wrong result innodb.alter_copy : MDEV-16181 - Assertion failure innodb.alter_crash : MDEV-16944 - The process cannot access the file innodb.alter_missing_tablespace : Modified in 10.2.32 -innodb.autoinc_persist : MDEV-15282 - Assertion failure +innodb.analyze_table : Modified in 10.2.33 innodb.binlog_consistent : MDEV-10618 - Server fails to start innodb.blob-crash : MDEV-20481 - Failures upon recovery -innodb.blob-update-debug : Modified in 10.2.31 innodb.buf_pool_resize_oom : Added in 10.2.32 innodb.corrupted_during_recovery : Modified in 10.2.32 innodb.doublewrite : MDEV-12905 - Server crash -innodb.foreign_key : Modified in 10.2.32 +innodb.foreign_key : Modified in 10.2.33 +innodb.foreign_key_debug : Added in 10.2.33 innodb.group_commit_crash : MDEV-14191 - InnoDB registration failed -innodb.group_commit_crash_no_optimize_thread : MDEV-13830 - Assertion failure innodb.ibuf_not_empty : MDEV-19021 - Wrong result innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup +innodb.innodb-alter : Modified in 10.2.33 innodb.innodb-alter-debug : MDEV-13182 - InnoDB: adjusting FSP_SPACE_FLAGS innodb.innodb-alter-table : MDEV-10619 - Testcase timeout innodb.innodb-blob : MDEV-12053 - Client crash; modified in 10.2.32 @@ -323,31 +325,26 @@ innodb.innodb-change-buffer-recovery : MDEV-19115 - Lost connection to M innodb.innodb-fk : MDEV-13832 - Assertion failure on shutdown innodb.innodb-get-fk : MDEV-13276 - Server crash innodb.innodb-index-online : MDEV-14809 - Cannot save statistics -innodb.innodb-online-alter-gis : MDEV-22071 - Uninitialised value innodb.innodb-page_compression_default : MDEV-13644 - Assertion failure innodb.innodb-page_compression_lzma : MDEV-14353 - Wrong result innodb.innodb-page_compression_zip : MDEV-10641 - mutex problem -innodb.innodb-replace-debug : Modified in 10.2.31 -innodb.innodb-stats-initialize-failure : Modified in 10.2.31 innodb.innodb-table-online : MDEV-13894 - Wrong result +innodb.innodb-ucs2 : MDEV-23370 - Server crash innodb.innodb-wl5522 : Modified in 10.2.32 +innodb.innodb-wl5522-1 : MDEV-22945 - Server crash innodb.innodb-wl5522-debug : MDEV-14200 - Wrong errno; modified in 10.2.32 innodb.innodb_buffer_pool_dump_pct : MDEV-20139 - Timeout in wait_condition.inc innodb.innodb_buffer_pool_load_now : Added in 10.2.32 innodb.innodb_buffer_pool_resize_debug : Added in 10.2.32 innodb.innodb_buffer_pool_resize_with_chunks : MDEV-16964 - Assertion failure -innodb.innodb_bug11754376 : Modified in 10.2.31 innodb.innodb_bug14147491 : MDEV-11808 - Index is corrupt -innodb.innodb_bug30113362 : Added in 10.2.31 innodb.innodb_bug30423 : MDEV-7311 - Wrong result innodb.innodb_bug47167 : MDEV-20524 - Table 'user' is marked as crashed and should be repaired innodb.innodb_bug48024 : MDEV-14352 - Assertion failure -innodb.innodb_bug56947 : Modified in 10.2.31 -innodb.innodb_bug59641 : MDEV-13830 - Assertion failure innodb.innodb_bulk_create_index_replication : MDEV-15273 - Slave failed to start -innodb.innodb_corrupt_bit : Modified in 10.2.31 innodb.innodb_defrag_concurrent : Modified in 10.2.32 innodb.innodb_defrag_stats_many_tables : MDEV-14198 - Table is full +innodb.innodb_force_recovery_rollback : Added in 10.2.33 innodb.innodb_information_schema : MDEV-8851 - Wrong result innodb.innodb_max_recordsize_32k : MDEV-14801 - Operation failed innodb.innodb_max_recordsize_64k : MDEV-15203 - Wrong result @@ -356,10 +353,8 @@ innodb.innodb_mysql : MDEV-19873 - Wrong result innodb.innodb_stats : MDEV-10682 - wrong result innodb.innodb_stats_persistent : MDEV-21567 - Wrong result in execution plan innodb.innodb_stats_persistent_debug : MDEV-14801 - Operation failed -innodb.innodb_sys_semaphore_waits : MDEV-10331 - Semaphore wait; modified in 10.2.31 +innodb.innodb_sys_semaphore_waits : MDEV-10331 - Semaphore wait innodb.innodb_sys_var_valgrind : Added in 10.2.32 -innodb.innodb_wl6326 : Added in 10.2.31 -innodb.innodb_wl6326_big : Added in 10.2.31 innodb.innodb_zip_innochecksum2 : MDEV-13882 - Warning: difficult to find free blocks innodb.log_corruption : MDEV-13251 - Wrong result innodb.log_data_file_size : MDEV-14204 - Server failed to start @@ -367,27 +362,27 @@ innodb.log_file_name : MDEV-14193 - Exception innodb.log_file_name_debug : Modified in 10.2.32 innodb.log_file_size : MDEV-15668 - Not found pattern innodb.monitor : MDEV-16179 - Wrong result +innodb.mvcc : Modified in 10.2.33 innodb.purge_secondary : MDEV-15681 - Wrong result innodb.purge_thread_shutdown : MDEV-13792 - Wrong result +innodb.read_only_recover_committed : Modified in 10.2.33 innodb.read_only_recovery : MDEV-13886 - Server crash innodb.recovery_shutdown : MDEV-15671 - Checksum mismatch in datafile -innodb.redo_log_during_checkpoint : Modified in 10.2.31 innodb.row_format_redundant : MDEV-15192 - Trying to access missing tablespace -innodb.row_size_error_log_warnings_3 : Modified in 10.2.31 innodb.table_definition_cache_debug : MDEV-14206 - Extra warning innodb.table_flags : MDEV-13572 - Wrong result; MDEV-19374 - Server failed to start innodb.temporary_table : MDEV-13265 - Wrong result -innodb.truncate_inject : Modified in 10.2.31 +innodb.truncate_foreign : Modified in 10.2.33 innodb.undo_truncate : MDEV-17340 - Server hung innodb.undo_truncate_recover : MDEV-17679 - MySQL server has gone away innodb.update_time : MDEV-14804 - Wrong result -innodb.xa_recovery : MDEV-15279 - mysqld got exception -innodb.xa_recovery_debug : Added in 10.2.32 +innodb.xa_recovery : MDEV-15279 - mysqld got exception; modified in 10.2.33 +innodb.xa_recovery_debug : Modified in 10.2.33 #----------------------------------------------------------------------- -innodb_fts.concurrent_insert : Modified in 10.2.31 -innodb_fts.innodb_fts_misc : Modified in 10.2.32 +innodb_fts.innodb-fts-ddl : Modified in 10.2.33 +innodb_fts.innodb_fts_misc : MDEV-23370 - Server crash; modified in 10.2.32 innodb_fts.innodb_fts_misc_debug : MDEV-14156 - Unexpected warning innodb_fts.innodb_fts_plugin : MDEV-13888 - Errors in server log innodb_fts.innodb_fts_stopword_charset : MDEV-13259 - Table crashed @@ -395,7 +390,6 @@ innodb_fts.misc_debug : Modified in 10.2.32 innodb_fts.misc_debug2 : Added in 10.2.32 innodb_fts.stopword : Added in 10.2.32 innodb_fts.sync : Modified in 10.2.32 -innodb_fts.sync_block : Modified in 10.2.31 innodb_fts.sync_ddl : MDEV-21568 - Errno: 2000 #----------------------------------------------------------------------- @@ -407,21 +401,20 @@ innodb_gis.gis_split_inf : Re-enabled in 10.2.32; modified in 10.2.32 innodb_gis.gis_split_nan : MDEV-21678 - Cannot get geometry object innodb_gis.point_big : Re-enabled in 10.2.32 innodb_gis.rtree_concurrent_srch : MDEV-15284 - Wrong result with embedded -innodb_gis.rtree_debug : Modified in 10.2.31 innodb_gis.rtree_multi_pk : Re-enabled in 10.2.32; modified in 10.2.32 innodb_gis.rtree_purge : MDEV-15275 - Timeout innodb_gis.rtree_recovery : MDEV-15274 - Error on check -innodb_gis.rtree_rollback1 : Modified in 10.2.31 -innodb_gis.rtree_rollback2 : Modified in 10.2.31 innodb_gis.rtree_split : MDEV-14208 - Too many arguments; modified in 10.2.32 innodb_gis.rtree_undo : MDEV-14456 - Timeout in include file innodb_gis.types : MDEV-15679 - Table is marked as crashed #----------------------------------------------------------------------- -innodb_zip.cmp_per_index : MDEV-14490 - Table is marked as crashed; modified in 10.2.31 +innodb_zip.cmp_per_index : MDEV-14490 - Table is marked as crashed +innodb_zip.create_options : MDEV-23370 - Server crash innodb_zip.index_large_prefix_4k : MDEV-21679 - Row size too large innodb_zip.innochecksum_3 : MDEV-13279 - Extra warnings +innodb_zip.recover : MDEV-22512 - Server fails to restart innodb_zip.wl5522_debug_zip : MDEV-11600 - Operating system error number 2; modified in 10.2.32 innodb_zip.wl5522_zip : Modified in 10.2.32 innodb_zip.wl6470_1 : MDEV-14240 - Assertion failure @@ -430,27 +423,27 @@ innodb_zip.wl6501_scale_1 : MDEV-13254 - Timeout, MDEV-14104 - Error 192 #----------------------------------------------------------------------- -maria.aria_pack_mdev14183 : Added in 10.2.31 -maria.insert_select : MDEV-12757 - Timeout -maria.insert_select-7314 : MDEV-16492 - Timeout -maria.maria : MDEV-14430 - Extra warning +maria.bulk_insert_crash : Added in 10.2.33 +maria.encrypt-no-key : Added in 10.2.33 +maria.insert_select : MDEV-12757 - Timeout +maria.insert_select-7314 : MDEV-16492 - Timeout +maria.maria : MDEV-14430 - Extra warning #----------------------------------------------------------------------- -mariabackup.apply-log-only : MDEV-20135 - Timeout -mariabackup.backup_lock_wait_timeout : Added in 10.2.32 -mariabackup.data_directory : MDEV-15270 - Error on exec -mariabackup.full_backup : MDEV-16571 - Wrong result -mariabackup.huge_lsn : MDEV-15662 - Sequence number is in the future -mariabackup.incremental_backup : MDEV-21222 - Memory allocation failure -mariabackup.incremental_encrypted : MDEV-15667 - Timeout -mariabackup.innodb_redo_log_overwrite : Added in 10.2.31 -mariabackup.innodb_xa_rollback : Added in 10.2.32 -mariabackup.mdev-14447 : MDEV-15201 - Timeout -mariabackup.partial_exclude : MDEV-15270 - Error on exec; modified in 10.2.32 -mariabackup.xb_compressed_encrypted : MDEV-14812 - Segmentation fault -mariabackup.xb_page_compress : MDEV-14810 - status: 1, errno: 11 -mariabackup.xb_partition : MDEV-17584 - Crash on shutdown +mariabackup.apply-log-only : MDEV-20135 - Timeout +mariabackup.backup_lock_wait_timeout : Added in 10.2.32 +mariabackup.data_directory : MDEV-15270 - Error on exec +mariabackup.full_backup : MDEV-16571 - Wrong result +mariabackup.huge_lsn : Modified in 10.2.33 +mariabackup.incremental_backup : MDEV-21222 - Memory allocation failure; modified in 10.2.33 +mariabackup.incremental_encrypted : MDEV-15667 - Timeout +mariabackup.innodb_xa_rollback : Added in 10.2.32 +mariabackup.mdev-14447 : MDEV-15201 - Timeout +mariabackup.partial_exclude : MDEV-15270 - Error on exec; modified in 10.2.32 +mariabackup.xb_compressed_encrypted : MDEV-14812 - Segmentation fault +mariabackup.xb_page_compress : MDEV-14810 - status: 1, errno: 11 +mariabackup.xb_partition : MDEV-17584 - Crash on shutdown #----------------------------------------------------------------------- @@ -480,25 +473,19 @@ multi_source.status_vars : MDEV-4632 - failed while waiting for Slave_received_h #----------------------------------------------------------------------- -optimizer_unfixed_bugs.bug36981 : Modified in 10.2.31 -optimizer_unfixed_bugs.bug40992 : Modified in 10.2.31 -optimizer_unfixed_bugs.bug41996 : Modified in 10.2.31 -optimizer_unfixed_bugs.bug42991 : Modified in 10.2.31 -optimizer_unfixed_bugs.bug43249 : Modified in 10.2.31 -optimizer_unfixed_bugs.bug43360 : Modified in 10.2.31 -optimizer_unfixed_bugs.bug43448 : Modified in 10.2.31 -optimizer_unfixed_bugs.bug43617 : Modified in 10.2.31 - -#----------------------------------------------------------------------- - -parts.partition_alter2_2_maria : MDEV-14364 - Lost connection to MySQL server during query -parts.partition_auto_increment_archive : MDEV-16491 - Marked as crashed and should be repaired -parts.partition_auto_increment_maria : MDEV-14430 - Extra warning -parts.partition_debug : Modified in 10.2.31 -parts.partition_debug_innodb : MDEV-10891 - Can't create UNIX socket; MDEV-15095 - Table doesn't exist; modified in 10.2.31 -parts.partition_exch_qa_10 : MDEV-11765 - wrong result -parts.partition_innodb_status_file : MDEV-12901 - Valgrind -parts.partition_special_innodb : MDEV-16942 - Timeout +parts.longname : Modified in 10.2.33 +parts.partition_alter2_2_maria : MDEV-14364 - Lost connection to MySQL server during query +parts.partition_auto_increment_archive : MDEV-16491 - Marked as crashed and should be repaired; include file modified in 10.2.33 +parts.partition_auto_increment_blackhole : Include file modified in 10.2.33 +parts.partition_auto_increment_innodb : Include file modified in 10.2.33 +parts.partition_auto_increment_maria : MDEV-14430 - Extra warning; include file modified in 10.2.33 +parts.partition_auto_increment_memory : Include file modified in 10.2.33 +parts.partition_auto_increment_myisam : Include file modified in 10.2.33 +parts.partition_debug : Modified in 10.2.33 +parts.partition_debug_innodb : MDEV-10891 - Can't create UNIX socket; MDEV-15095 - Table doesn't exist +parts.partition_exch_qa_10 : MDEV-11765 - wrong result +parts.partition_innodb_status_file : MDEV-12901 - Valgrind +parts.partition_special_innodb : MDEV-16942 - Timeout #----------------------------------------------------------------------- @@ -506,58 +493,26 @@ percona.* : MDEV-10997 - Not maintained #----------------------------------------------------------------------- -perfschema.bad_option_1 : MDEV-21571 - Crash on bootstrap -perfschema.connect_attrs : MDEV-17283 - Wrong result -perfschema.dml_file_instances : MDEV-15179 - Wrong result -perfschema.dml_threads : MDEV-17746 - Wrong errno -perfschema.func_file_io : MDEV-5708 - fails for s390x -perfschema.func_mutex : MDEV-5708 - fails for s390x -perfschema.hostcache_ipv4_addrinfo_again_allow : MDEV-12759 - Crash; modified in 10.2.31 -perfschema.hostcache_ipv4_addrinfo_again_deny : Modified in 10.2.31 -perfschema.hostcache_ipv4_addrinfo_bad_allow : Modified in 10.2.31 -perfschema.hostcache_ipv4_addrinfo_bad_deny : Modified in 10.2.31 -perfschema.hostcache_ipv4_addrinfo_good_allow : Modified in 10.2.31 -perfschema.hostcache_ipv4_addrinfo_good_deny : Modified in 10.2.31 -perfschema.hostcache_ipv4_addrinfo_noname_allow : Modified in 10.2.31 -perfschema.hostcache_ipv4_addrinfo_noname_deny : Modified in 10.2.31 -perfschema.hostcache_ipv4_auth_plugin : Modified in 10.2.31 -perfschema.hostcache_ipv4_blocked : Modified in 10.2.31 -perfschema.hostcache_ipv4_format : Modified in 10.2.31 -perfschema.hostcache_ipv4_max_con : Modified in 10.2.31 -perfschema.hostcache_ipv4_nameinfo_again_allow : Modified in 10.2.31 -perfschema.hostcache_ipv4_nameinfo_again_deny : Modified in 10.2.31 -perfschema.hostcache_ipv4_nameinfo_noname_allow : Modified in 10.2.31 -perfschema.hostcache_ipv4_nameinfo_noname_deny : Modified in 10.2.31 -perfschema.hostcache_ipv4_passwd : Modified in 10.2.31 -perfschema.hostcache_ipv4_ssl : Modified in 10.2.31 -perfschema.hostcache_ipv6_addrinfo_again_allow : MDEV-12752 - Crash; modified in 10.2.31 -perfschema.hostcache_ipv6_addrinfo_again_deny : Modified in 10.2.31 -perfschema.hostcache_ipv6_addrinfo_bad_allow : MDEV-13260 - Crash; modified in 10.2.31 -perfschema.hostcache_ipv6_addrinfo_bad_deny : Modified in 10.2.31 -perfschema.hostcache_ipv6_addrinfo_good_allow : Modified in 10.2.31 -perfschema.hostcache_ipv6_addrinfo_good_deny : Modified in 10.2.31 -perfschema.hostcache_ipv6_addrinfo_noname_allow : Modified in 10.2.31 -perfschema.hostcache_ipv6_addrinfo_noname_deny : Modified in 10.2.31 -perfschema.hostcache_ipv6_auth_plugin : Modified in 10.2.31 -perfschema.hostcache_ipv6_blocked : Modified in 10.2.31 -perfschema.hostcache_ipv6_max_con : Modified in 10.2.31 -perfschema.hostcache_ipv6_nameinfo_again_allow : Modified in 10.2.31 -perfschema.hostcache_ipv6_nameinfo_again_deny : Modified in 10.2.31 -perfschema.hostcache_ipv6_nameinfo_noname_allow : Modified in 10.2.31 -perfschema.hostcache_ipv6_nameinfo_noname_deny : Modified in 10.2.31 -perfschema.hostcache_ipv6_passwd : Modified in 10.2.31 -perfschema.hostcache_ipv6_ssl : MDEV-10696 - Crash; modified in 10.2.31 -perfschema.hostcache_peer_addr : MDEV-21462 - Test condition timeout; modified in 10.2.31 -perfschema.privilege_table_io : MDEV-13184 - Extra lines -perfschema.rpl_gtid_func : MDEV-16897 - Wrong result -perfschema.socket_instances_func : MDEV-20140 - Wrong result -perfschema.socket_summary_by_event_name_func : MDEV-10622 - Wrong result -perfschema.socket_summary_by_instance_func : MDEV-19413 - Wrong result -perfschema.stage_mdl_global : MDEV-11803 - wrong result on slow builders -perfschema.stage_mdl_procedure : MDEV-11545 - Missing row -perfschema.stage_mdl_table : MDEV-12638 - Wrong result -perfschema.start_server_low_digest : MDEV-21221 - Wrong result -perfschema.threads_mysql : MDEV-10677 - Wrong result +perfschema.bad_option_1 : MDEV-21571 - Crash on bootstrap +perfschema.connect_attrs : MDEV-17283 - Wrong result +perfschema.dml_file_instances : MDEV-15179 - Wrong result +perfschema.dml_threads : MDEV-17746 - Wrong errno +perfschema.func_file_io : MDEV-5708 - fails for s390x +perfschema.func_mutex : MDEV-5708 - fails for s390x +perfschema.hostcache_ipv4_addrinfo_again_allow : MDEV-12759 - Crash +perfschema.hostcache_ipv6_addrinfo_again_allow : MDEV-12752 - Crash +perfschema.hostcache_ipv6_addrinfo_bad_allow : MDEV-13260 - Crash +perfschema.hostcache_ipv6_ssl : MDEV-10696 - Crash +perfschema.privilege_table_io : MDEV-13184 - Extra lines +perfschema.rpl_gtid_func : MDEV-16897 - Wrong result +perfschema.socket_instances_func : MDEV-20140 - Wrong result +perfschema.socket_summary_by_event_name_func : MDEV-10622 - Wrong result +perfschema.socket_summary_by_instance_func : MDEV-19413 - Wrong result +perfschema.stage_mdl_global : MDEV-11803 - wrong result on slow builders +perfschema.stage_mdl_procedure : MDEV-11545 - Missing row +perfschema.stage_mdl_table : MDEV-12638 - Wrong result +perfschema.start_server_low_digest : MDEV-21221 - Wrong result +perfschema.threads_mysql : MDEV-10677 - Wrong result #----------------------------------------------------------------------- @@ -565,6 +520,7 @@ perfschema_stress.* : MDEV-10996 - Not maintained #----------------------------------------------------------------------- +plugins.audit_null_debug : Modified in 10.2.33 plugins.feedback_plugin_send : MDEV-7932, MDEV-11118 - Connection problems and such plugins.processlist : MDEV-16574 - Wrong result plugins.server_audit : MDEV-9562 - crashes on sol10-sparc; modified in 10.2.32 @@ -603,120 +559,109 @@ rocksdb_rpl.rpl_binlog_xid_count : MDEV-16644 - Server crash #----------------------------------------------------------------------- -roles.create_and_grant_role : MDEV-11772 - wrong result +roles.create_and_grant_role : MDEV-11772 - wrong result +roles.drop_current_role : Added in 10.2.33 +roles.set_default_role_invalid : Modified in 10.2.33 #----------------------------------------------------------------------- -rpl.circular_serverid0 : MDEV-19372 - ASAN heap-use-after-free; modified in 10.2.32 -rpl.create_or_replace2 : MDEV-19412 - Lost connection to MySQL server -rpl.create_or_replace_mix : MDEV-20523 - Wrong result -rpl.create_or_replace_statement : MDEV-20523 - Wrong result -rpl.create_select : MDEV-14121 - Assertion failure -rpl.kill_race_condition : Modified in 10.2.31 -rpl.last_insert_id : MDEV-10625 - warnings in error log -rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips -rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips -rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log -rpl.rpl_binlog_errors : MDEV-12742 - Crash; include file modified in 10.2.32 -rpl.rpl_binlog_index : MDEV-9501 - Failed registering on master -rpl.rpl_binlog_rollback_cleanup : Added in 10.2.31 -rpl.rpl_bug33931 : Modified in 10.2.31 -rpl.rpl_bug41902 : Configuration deleted in 10.2.32 -rpl.rpl_checksum : Include file modified in 10.2.31 -rpl.rpl_colSize : MDEV-16112 - Server crash -rpl.rpl_conditional_comments : Modified in 10.2.32 -rpl.rpl_corruption : Include file modified in 10.2.32 -rpl.rpl_ctype_latin1 : MDEV-14813 - Wrong result on Mac -rpl.rpl_ddl : MDEV-10417 - Fails on Mips -rpl.rpl_domain_id_filter_io_crash : MDEV-12729 - Timeout in include file, MDEV-13677 - Server crash; modified in 10.2.32 -rpl.rpl_domain_id_filter_master_crash : MDEV-19043 - Warnings/errors; modified in 10.2.31 -rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result -rpl.rpl_drop_db_fail : MDEV-16898 - Slave fails to start -rpl.rpl_extra_col_master_innodb : MDEV-16570 - Extra warning -rpl.rpl_extra_col_master_myisam : MDEV-14203 - Extra warning -rpl.rpl_fail_register : MDEV-22472 - Wrong result; added in 10.2.32 -rpl.rpl_flushlog_loop : MDEV-21570 - Server crash -rpl.rpl_get_lock : MDEV-19368 - mysqltest failed but provided no output -rpl.rpl_get_master_version_and_clock : Re-enabled in 10.2.32; include file modified in 10.2.32 -rpl.rpl_gtid_basic : MDEV-10681 - server startup problem -rpl.rpl_gtid_crash : MDEV-9501 - Failed registering on master, MDEV-13643 - Lost connection -rpl.rpl_gtid_delete_domain : MDEV-14463 - Timeout -rpl.rpl_gtid_errorhandling : MDEV-13261 - Crash -rpl.rpl_gtid_mdev9033 : MDEV-10680 - warnings -rpl.rpl_gtid_reconnect : MDEV-14497 - Crash; modified in 10.2.31 -rpl.rpl_gtid_startpos : MDEV-20141 - mysqltest failed but provided no output -rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown, MDEV-12629 - Valgrind warnings -rpl.rpl_gtid_strict : Modified in 10.2.32 -rpl.rpl_gtid_until : MDEV-10625 - warnings in error log -rpl.rpl_heartbeat_debug : Modified in 10.2.31 -rpl.rpl_incident : Include file modified in 10.2.31 -rpl.rpl_init_slave_errors : Include file modified in 10.2.31 -rpl.rpl_innodb_bug30888 : MDEV-10417 - Fails on Mips -rpl.rpl_insert : MDEV-9329 - Fails on Ubuntu/s390x -rpl.rpl_insert_delayed : MDEV-9329 - Fails on Ubuntu/s390x -rpl.rpl_insert_id : MDEV-15197 - Wrong result -rpl.rpl_insert_id_pk : MDEV-16567 - Assertion failure -rpl.rpl_insert_ignore : MDEV-14365 - Lost connection to MySQL server during query -rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips -rpl.rpl_mariadb_slave_capability : MDEV-11018 - Extra lines in binlog; modified in 10.2.31 -rpl.rpl_mdev12179 : MDEV-19043 - Warnings/errors -rpl.rpl_mdev6020 : MDEV-15272 - Server crash -rpl.rpl_mixed_mixing_engines : MDEV-21266 - Timeout -rpl.rpl_non_direct_row_mixing_engines : MDEV-16561 - Timeout in master_pos_wait -rpl.rpl_parallel : MDEV-10653 - Timeouts; include file modified in 10.2.31 -rpl.rpl_parallel_conflicts : MDEV-15272 - Server crash -rpl.rpl_parallel_mdev6589 : MDEV-12979 - Assertion failure -rpl.rpl_parallel_multilevel2 : MDEV-14723 - Timeout -rpl.rpl_parallel_optimistic : MDEV-15278 - Failed to sync with master; modified in 10.2.31 -rpl.rpl_parallel_optimistic_nobinlog : MDEV-15278 - Failed to sync with master -rpl.rpl_parallel_retry : MDEV-11119 - Crash; MDEV-17109 - Timeout -rpl.rpl_parallel_temptable : MDEV-10356 - Crash; MDEV-19076 - Wrong result -rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips -rpl.rpl_password_boundaries : MDEV-11534 - Slave IO warnings -rpl.rpl_row_001 : MDEV-16653 - Internal check fails -rpl.rpl_row_basic_11bugs : MDEV-12171 - Server failed to start -rpl.rpl_row_basic_2myisam : MDEV-13875 - command "diff_files" failed -rpl.rpl_row_big_table_id : Modified in 10.2.31 -rpl.rpl_row_corruption : MDEV-21569 - mutex: LOCK_global_system_variables unlocking; modified in 10.2.32 -rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result -rpl.rpl_row_find_row_debug : Modified in 10.2.31 -rpl.rpl_row_img_blobs : MDEV-13875 - command "diff_files" failed -rpl.rpl_row_img_eng_min : MDEV-13875 - diff_files failed -rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed -rpl.rpl_row_index_choice : MDEV-15196 - Slave crash; modified in 10.2.31 -rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x -rpl.rpl_row_until : MDEV-14052 - Master will not send events with checksum -rpl.rpl_semi_sync : MDEV-11220 - Wrong result -rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result -rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result -rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings -rpl.rpl_semi_sync_skip_repl : Modified in 10.2.31 -rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Assorted failures -rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition -rpl.rpl_set_statement_default_master : MDEV-13258 - Extra warning -rpl.rpl_show_slave_hosts : MDEV-10681 - Crash -rpl.rpl_show_slave_running : Modified in 10.2.31 -rpl.rpl_skip_replication : MDEV-13258 - Extra warning -rpl.rpl_slave_grp_exec : MDEV-10514 - Deadlock -rpl.rpl_slave_load_remove_tmpfile : Modified in 10.2.31 -rpl.rpl_slave_load_tmpdir_not_exist : MDEV-14203 - Extra warning -rpl.rpl_slow_query_log : MDEV-13250 - Test abort -rpl.rpl_sp_effects : MDEV-13249 - Crash -rpl.rpl_start_stop_slave : MDEV-13567 - Sync slave timeout -rpl.rpl_stm_lcase_tblnames : Modified in 10.2.31 -rpl.rpl_stm_multi_query : MDEV-9501 - Failed registering on master -rpl.rpl_stm_relay_ign_space : MDEV-14360 - Test assertion -rpl.rpl_stm_stop_middle_group : MDEV-13791 - Server crash; include file modified in 10.2.32 -rpl.rpl_stop_slave : Modified in 10.2.31 -rpl.rpl_sync : MDEV-13830 - Assertion failure -rpl.rpl_temporal_mysql56_to_mariadb53 : MDEV-9501 - Failed registering on master -rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries -rpl.rpl_test_framework : MDEV-19368 - mysqltest failed but provided no output -rpl.rpl_trigger : MDEV-18055 - Wrong result -rpl.rpl_truncate_3innodb : MDEV-19454 - Sporadic syntax error -rpl.rpl_user_variables : MDEV-20522 - Wrong result -rpl.rpl_view_debug : Modified in 10.2.31 -rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result +rpl.circular_serverid0 : MDEV-19372 - ASAN heap-use-after-free; modified in 10.2.32 +rpl.create_or_replace2 : MDEV-19412 - Lost connection to MySQL server +rpl.create_or_replace_mix : MDEV-20523 - Wrong result +rpl.create_or_replace_statement : MDEV-20523 - Wrong result +rpl.create_select : MDEV-14121 - Assertion failure +rpl.last_insert_id : MDEV-10625 - warnings in error log +rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips +rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips +rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log +rpl.rpl_binlog_dump_slave_gtid_state_info : Added in 10.2.33 +rpl.rpl_binlog_errors : MDEV-12742 - Crash; include file modified in 10.2.32 +rpl.rpl_binlog_index : MDEV-9501 - Failed registering on master +rpl.rpl_bug41902 : Configuration deleted in 10.2.32 +rpl.rpl_checksum_cache : MDEV-22510 - Server crash +rpl.rpl_colSize : MDEV-16112 - Server crash +rpl.rpl_conditional_comments : Modified in 10.2.32 +rpl.rpl_corruption : Include file modified in 10.2.32 +rpl.rpl_ctype_latin1 : MDEV-14813 - Wrong result on Mac +rpl.rpl_ddl : MDEV-10417 - Fails on Mips +rpl.rpl_domain_id_filter_io_crash : MDEV-12729 - Timeout in include file, MDEV-13677 - Server crash; modified in 10.2.32 +rpl.rpl_domain_id_filter_master_crash : MDEV-19043 - Warnings/errors +rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result +rpl.rpl_drop_db_fail : MDEV-16898 - Slave fails to start +rpl.rpl_dump_request_retry_warning : Added in 10.2.33 +rpl.rpl_extra_col_master_innodb : MDEV-16570 - Extra warning +rpl.rpl_fail_register : Modified in 10.2.33 +rpl.rpl_flushlog_loop : MDEV-21570 - Server crash +rpl.rpl_get_lock : MDEV-19368 - mysqltest failed but provided no output +rpl.rpl_get_master_version_and_clock : Re-enabled in 10.2.32; include file modified in 10.2.32 +rpl.rpl_gtid_basic : MDEV-10681 - server startup problem +rpl.rpl_gtid_crash : MDEV-9501 - Failed registering on master, MDEV-13643 - Lost connection +rpl.rpl_gtid_delete_domain : MDEV-14463 - Timeout; MDEV-23103 - Could not delete gtid domain +rpl.rpl_gtid_errorhandling : MDEV-13261 - Crash +rpl.rpl_gtid_mdev9033 : MDEV-10680 - warnings +rpl.rpl_gtid_reconnect : MDEV-14497 - Crash +rpl.rpl_gtid_startpos : MDEV-20141 - mysqltest failed but provided no output +rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown, MDEV-12629 - Valgrind warnings +rpl.rpl_gtid_strict : Modified in 10.2.32 +rpl.rpl_gtid_until : MDEV-10625 - warnings in error log +rpl.rpl_innodb_bug30888 : MDEV-10417 - Fails on Mips +rpl.rpl_insert : MDEV-9329 - Fails on Ubuntu/s390x +rpl.rpl_insert_delayed : MDEV-9329 - Fails on Ubuntu/s390x +rpl.rpl_insert_id : MDEV-15197 - Wrong result +rpl.rpl_insert_id_pk : MDEV-16567 - Assertion failure +rpl.rpl_insert_ignore : MDEV-14365 - Lost connection to MySQL server during query +rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips +rpl.rpl_mariadb_slave_capability : MDEV-11018 - Extra lines in binlog +rpl.rpl_mdev12179 : MDEV-19043 - Warnings/errors +rpl.rpl_mdev6020 : MDEV-15272 - Server crash +rpl.rpl_mixed_mixing_engines : MDEV-21266 - Timeout +rpl.rpl_non_direct_row_mixing_engines : MDEV-16561 - Timeout in master_pos_wait +rpl.rpl_parallel : MDEV-10653 - Timeouts +rpl.rpl_parallel2 : MDEV-23089 - Server hang +rpl.rpl_parallel_conflicts : MDEV-15272 - Server crash +rpl.rpl_parallel_mdev6589 : MDEV-12979 - Assertion failure +rpl.rpl_parallel_multilevel2 : MDEV-14723 - Timeout +rpl.rpl_parallel_optimistic : MDEV-15278 - Failed to sync with master +rpl.rpl_parallel_optimistic_nobinlog : MDEV-15278 - Failed to sync with master +rpl.rpl_parallel_optimistic_until : MDEV-23021 - Query didn't return a result set; added in 10.2.33 +rpl.rpl_parallel_retry : MDEV-11119 - Crash; MDEV-17109 - Timeout +rpl.rpl_parallel_temptable : MDEV-10356 - Crash; MDEV-19076 - Wrong result +rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips +rpl.rpl_password_boundaries : MDEV-11534 - Slave IO warnings +rpl.rpl_row_001 : MDEV-16653 - Internal check fails +rpl.rpl_row_basic_11bugs : MDEV-12171 - Server failed to start +rpl.rpl_row_basic_2myisam : MDEV-13875 - command "diff_files" failed +rpl.rpl_row_corruption : MDEV-21569 - mutex: LOCK_global_system_variables unlocking; modified in 10.2.32 +rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result +rpl.rpl_row_img_blobs : MDEV-13875 - command "diff_files" failed +rpl.rpl_row_img_eng_min : MDEV-13875 - diff_files failed +rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed +rpl.rpl_row_index_choice : MDEV-15196 - Slave crash +rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x +rpl.rpl_row_until : MDEV-14052 - Master will not send events with checksum +rpl.rpl_row_virt : Added in 10.2.33 +rpl.rpl_semi_sync : MDEV-11220 - Wrong result +rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result +rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result +rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings +rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Assorted failures +rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition +rpl.rpl_show_slave_hosts : MDEV-10681 - Crash +rpl.rpl_skip_replication : MDEV-23372 - Extra warning +rpl.rpl_slave_grp_exec : MDEV-10514 - Deadlock +rpl.rpl_slow_query_log : MDEV-13250 - Test abort +rpl.rpl_sp_effects : MDEV-13249 - Crash +rpl.rpl_start_stop_slave : MDEV-13567 - Sync slave timeout +rpl.rpl_stm_multi_query : MDEV-9501 - Failed registering on master +rpl.rpl_stm_relay_ign_space : MDEV-14360 - Test assertion +rpl.rpl_stm_stop_middle_group : MDEV-13791 - Server crash; include file modified in 10.2.32 +rpl.rpl_temporal_mysql56_to_mariadb53 : MDEV-9501 - Failed registering on master +rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries +rpl.rpl_test_framework : MDEV-19368 - mysqltest failed but provided no output +rpl.rpl_trigger : MDEV-18055 - Wrong result +rpl.rpl_truncate_3innodb : MDEV-19454 - Sporadic syntax error +rpl.rpl_user_variables : MDEV-20522 - Wrong result +rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result #----------------------------------------------------------------------- @@ -757,17 +702,19 @@ storage_engine.* : Tests are not always timely maintained #----------------------------------------------------------------------- +stress.* : Added to default set in 10.2.33 stress.ddl_innodb : MDEV-10635 - Testcase timeout +stress.misc : Added in 10.2.33 #----------------------------------------------------------------------- sys_vars.autocommit_func2 : MDEV-9329 - Fails on Ubuntu/s390x -sys_vars.debug_dbug_func : Modified in 10.2.31 sys_vars.innodb_buffer_pool_dump_at_shutdown_basic : MDEV-14280 - Unexpected error -sys_vars.innodb_buffer_pool_size_basic : Modified in 10.2.31 sys_vars.innodb_checksum_algorithm_basic : MDEV-21568 - Errno: 2000 sys_vars.keep_files_on_create_basic : MDEV-10676 - timeout sys_vars.log_slow_admin_statements_func : MDEV-12235 - Server crash +sys_vars.max_sort_length_basic : Modified in 10.2.33 +sys_vars.optimizer_switch_basic : Modified in 10.2.33 sys_vars.rpl_init_slave_func : MDEV-10149 - Test assertion sys_vars.slow_query_log_func : MDEV-14273 - Wrong result sys_vars.thread_cache_size_func : MDEV-11775 - Wrong result @@ -816,7 +763,8 @@ tokudb_bugs.xa : MDEV-11804 - Lock wait timeout #----------------------------------------------------------------------- -tokudb_parts.partition_alter4_tokudb : MDEV-12640 - Lost connection +tokudb_parts.partition_alter4_tokudb : MDEV-12640 - Lost connection +tokudb_parts.partition_auto_increment_tokudb : Include file modified in 10.2.33 #----------------------------------------------------------------------- @@ -836,28 +784,23 @@ unit.conc_ps_bugs : MDEV-13252 - not ok 44 test_bug4236 unit.ma_pagecache_consist_64kRD : MDEV-19367 - AddressSanitizer CHECK failed unit.ma_pagecache_consist_64kWR : MDEV-19367 - AddressSanitizer CHECK failed unit.ma_test_loghandler : MDEV-10638 - record read not ok +unit.mf_iocache : MDEV-20952 - Buffer overflow #----------------------------------------------------------------------- vcol.not_supported : MDEV-10639 - Testcase timeout vcol.vcol_keys_innodb : MDEV-10639 - Testcase timeout -vcol.vcol_misc : MDEV-16651 - Wrong error message +vcol.vcol_keys_myisam : Modified in 10.2.33 +vcol.vcol_misc : MDEV-16651 - Wrong error message; modified in 10.2.33 #----------------------------------------------------------------------- -wsrep.* : Config file changed in 10.2.31 -wsrep.alter_table_innodb : Configuration deleted in 10.2.31 -wsrep.binlog_format : Configuration modified in 10.2.31 -wsrep.foreign_key : MDEV-14725 - WSREP has not yet prepared node; re-enabled in 10.2.31 -wsrep.mdev_10186 : Configuration added in 10.2.31 -wsrep.mdev_6832 : MDEV-14195 - Check testcase failed -wsrep.mysql_tzinfo_to_sql_symlink : Modified in 10.2.31 -wsrep.mysql_tzinfo_to_sql_symlink_skip : Modified in 10.2.31 -wsrep.pool_of_threads : MDEV-17345 - WSREP has not yet prepared node for application use; re-enabled in 10.2.31; configuration modified in 10.2.31 -wsrep.trans : Modified in 10.2.32 -wsrep.variables : MDEV-17585 - Deadlock; modified in 10.2.31 +wsrep.foreign_key : MDEV-14725 - WSREP has not yet prepared node +wsrep.mdev_6832 : MDEV-14195 - Check testcase failed +wsrep.pool_of_threads : MDEV-17345 - WSREP has not yet prepared node for application use +wsrep.trans : Modified in 10.2.32 +wsrep.variables : MDEV-17585 - Deadlock #----------------------------------------------------------------------- -wsrep_info.* : Config file changed in 10.2.31 wsrep_info.plugin : MDEV-22470 - WSREP: no nodes coming from prim view, prim not possible From acfc500d037bbe1e2d9de8d713e3cf01bb7716aa Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 2 Aug 2020 19:42:45 +0200 Subject: [PATCH 34/35] compilation error on bintar-centos6-amd64-debug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /home/buildbot/buildbot/build/storage/xtradb/mtr/mtr0mtr.cc:97:37: error: invalid access to non-static data member ‘fil_space_t::latch’ of NULL object [-Werror=invalid-offsetof] --- storage/xtradb/mtr/mtr0mtr.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/storage/xtradb/mtr/mtr0mtr.cc b/storage/xtradb/mtr/mtr0mtr.cc index a04f9cc84a3..ce1002a00f0 100644 --- a/storage/xtradb/mtr/mtr0mtr.cc +++ b/storage/xtradb/mtr/mtr0mtr.cc @@ -93,8 +93,7 @@ mtr_memo_slot_release_func( { fil_space_t* space = reinterpret_cast( static_cast(object) - - reinterpret_cast( - &static_cast(0)->latch)); + - my_offsetof(fil_space_t, latch)); space->committed_size = space->size; rw_lock_x_unlock(&space->latch); } From 8bca92c8845212ea96be404e664f4cbb45f93e2d Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Mon, 3 Aug 2020 13:03:37 +0300 Subject: [PATCH 35/35] Fix the typo in fix for MDEV-21472 --- sql/sql_admin.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index beecf3fae64..3f518312526 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -738,7 +738,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, */ collect_eis= (table->table->s->table_category == TABLE_CATEGORY_USER && - !(lex->alter_info.flags &= Alter_info::ALTER_ADMIN_PARTITION) && + !(lex->alter_info.flags & Alter_info::ALTER_ADMIN_PARTITION) && (get_use_stat_tables_mode(thd) > NEVER || lex->with_persistent_for_clause));