Commit 6be6b4ab authored by Olivier Bertrand's avatar Olivier Bertrand

- All the processing of creating, dropping, modifying indexes was redesigned.

  The code was a legacy from the first versions of the XDB engine dating 2004
  and was not working anymore with recent versions of MySQL/MariaDB. A patch
  in create had been added but is was unsatisfying, recreating all indexes on
  any alter statement and sometimes doing nothing when it should have.
  This is a major update to be tested for stability. It was in most important
  cases et all current tests pass with this new version

modified:
  storage/connect/global.h
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/mycat.cc
  storage/connect/plugutil.c
  storage/connect/tabdos.cpp
  storage/connect/user_connect.cc
  storage/connect/user_connect.h
  storage/connect/xindex.h
parent b3b02104
...@@ -220,6 +220,7 @@ typedef struct _global { /* Global structure */ ...@@ -220,6 +220,7 @@ typedef struct _global { /* Global structure */
char Message[MAX_STR]; char Message[MAX_STR];
short Trace; short Trace;
int Createas; /* To pass info to created table */ int Createas; /* To pass info to created table */
void *Xchk; /* indexes in create/alter */
int jump_level; int jump_level;
jmp_buf jumper[MAX_JUMP + 2]; jmp_buf jumper[MAX_JUMP + 2];
} GLOBAL; } GLOBAL;
......
...@@ -881,6 +881,25 @@ bool ha_connect::GetBooleanOption(char *opname, bool bdef) ...@@ -881,6 +881,25 @@ bool ha_connect::GetBooleanOption(char *opname, bool bdef)
return opval; return opval;
} // end of GetBooleanOption } // end of GetBooleanOption
/****************************************************************************/
/* Set the value of the opname option (does not work for oplist options) */
/* Currently used only to set the Sepindex value. */
/****************************************************************************/
bool ha_connect::SetBooleanOption(char *opname, bool b)
{
PTOS options= GetTableOptionStruct(table);
if (!options)
return true;
if (!stricmp(opname, "SepIndex"))
options->sepindex= b;
else
return true;
return false;
} // end of SetBooleanOption
/****************************************************************************/ /****************************************************************************/
/* Return the value of an integer option or NO_IVAL if not specified. */ /* Return the value of an integer option or NO_IVAL if not specified. */
/****************************************************************************/ /****************************************************************************/
...@@ -1167,27 +1186,28 @@ void *ha_connect::GetColumnOption(void *field, PCOLINFO pcf) ...@@ -1167,27 +1186,28 @@ void *ha_connect::GetColumnOption(void *field, PCOLINFO pcf)
/****************************************************************************/ /****************************************************************************/
/* Returns the index description structure used to make the index. */ /* Returns the index description structure used to make the index. */
/****************************************************************************/ /****************************************************************************/
PIXDEF ha_connect::GetIndexInfo(int n) PIXDEF ha_connect::GetIndexInfo(void)
{ {
char *name, *pn; char *name, *pn;
bool unique; bool unique;
PIXDEF xdp= NULL; PIXDEF xdp, pxd=NULL, toidx= NULL;
PKPDEF kpp, pkp= NULL; PKPDEF kpp, pkp;
PGLOBAL& g= xp->g; PGLOBAL& g= xp->g;
KEY kp; KEY kp;
for (int n= 0; (unsigned)n < table->s->keynames.count; n++) {
if (xtrace)
printf("Getting created index %d info\n", n + 1);
// Find the index to describe // Find the index to describe
if ((unsigned)n < table->s->keynames.count)
// kp= table->key_info[n]; which one ???
kp= table->s->key_info[n]; kp= table->s->key_info[n];
else
return NULL;
// Now get index information // Now get index information
pn= (char*)table->s->keynames.type_names[n]; pn= (char*)table->s->keynames.type_names[n];
name= (char*)PlugSubAlloc(g, NULL, strlen(pn) + 1); name= (char*)PlugSubAlloc(g, NULL, strlen(pn) + 1);
strcpy(name, pn); // This is probably unuseful strcpy(name, pn); // This is probably unuseful
unique= (kp.flags & 1) != 0; unique= (kp.flags & 1) != 0;
pkp= NULL;
// Allocate the index description block // Allocate the index description block
xdp= new(g) INDEXDEF(name, unique, n); xdp= new(g) INDEXDEF(name, unique, n);
...@@ -1222,7 +1242,16 @@ PIXDEF ha_connect::GetIndexInfo(int n) ...@@ -1222,7 +1242,16 @@ PIXDEF ha_connect::GetIndexInfo(int n)
} // endfor k } // endfor k
xdp->SetNParts(kp.key_parts); xdp->SetNParts(kp.key_parts);
return xdp;
if (pxd)
pxd->SetNext(xdp);
else
toidx= xdp;
pxd= xdp;
} // endfor n
return toidx;
} // end of GetIndexInfo } // end of GetIndexInfo
const char *ha_connect::GetDBName(const char* name) const char *ha_connect::GetDBName(const char* name)
...@@ -1387,10 +1416,11 @@ bool ha_connect::OpenTable(PGLOBAL g, bool del) ...@@ -1387,10 +1416,11 @@ bool ha_connect::OpenTable(PGLOBAL g, bool del)
istable= true; istable= true;
// strmake(tname, table_name, sizeof(tname)-1); // strmake(tname, table_name, sizeof(tname)-1);
if (xmod == MODE_ANY && *tdbp->GetName() != '#')
// We may be in a create index query // We may be in a create index query
if (xp) // xp can be null when called from create if (xmod == MODE_ANY && *tdbp->GetName() != '#') {
xp->tabp= (PTDBDOS)tdbp; // The table on which the index is created // The current indexes
PIXDEF oldpix= GetIndexInfo();
} // endif xmod
// tdbp->SetOrig((PTBX)table); // used by CheckCond // tdbp->SetOrig((PTBX)table); // used by CheckCond
} else } else
...@@ -2984,7 +3014,7 @@ err: ...@@ -2984,7 +3014,7 @@ err:
int ha_connect::external_lock(THD *thd, int lock_type) int ha_connect::external_lock(THD *thd, int lock_type)
{ {
int rc= 0; int rc= 0;
bool del= false; bool del= false, xcheck=false, cras= false;
MODE newmode; MODE newmode;
PTOS options= GetTableOptionStruct(table); PTOS options= GetTableOptionStruct(table);
PGLOBAL g= GetPlug(thd); PGLOBAL g= GetPlug(thd);
...@@ -3019,52 +3049,89 @@ int ha_connect::external_lock(THD *thd, int lock_type) ...@@ -3019,52 +3049,89 @@ int ha_connect::external_lock(THD *thd, int lock_type)
// This is unlocking, do it by closing the table // This is unlocking, do it by closing the table
if (xp->CheckQueryID()) if (xp->CheckQueryID())
rc= 2; // Logical error ??? rc= 2; // Logical error ???
else if (tdbp) { else if (g->Xchk) {
if (tdbp->GetMode() == MODE_ANY && *tdbp->GetName() == '#' && if (!tdbp || *tdbp->GetName() == '#') {
xp->tabp && ((PTDBASE)tdbp)->GetDef()->Indexable()) { bool oldsep= ((PCHK)g->Xchk)->oldsep;
PDOSDEF defp1= (PDOSDEF)((PTDBASE)tdbp)->GetDef(); bool newsep= ((PCHK)g->Xchk)->newsep;
PDOSDEF defp2= (PDOSDEF)xp->tabp->GetDef(); PTDBDOS tdp= (PTDBDOS)(tdbp ? tdbp : GetTDB(g));
PIXDEF xp1, xp2, sxp; PDOSDEF ddp= (PDOSDEF)tdp->GetDef();
PIXDEF xp, xp1, xp2, drp=NULL, adp= NULL;
// Look for new created indexes PIXDEF oldpix= ((PCHK)g->Xchk)->oldpix;
for (xp1= defp1->GetIndx(); xp1; xp1= xp1->GetNext()) { PIXDEF newpix= ((PCHK)g->Xchk)->newpix;
for (xp2= defp2->GetIndx(); xp2; xp2= xp2->GetNext()) PIXDEF *xlst, *xprc;
if (!stricmp(xp1->GetName(), xp2->GetName()))
break; // Index already made ddp->SetIndx(oldpix);
if (oldsep != newsep) {
// All indexes have to be remade
ddp->DeleteIndexFile(g, NULL);
oldpix= NULL;
ddp->SetIndx(NULL);
SetBooleanOption("Sepindex", newsep);
} else if (newsep) {
// Make the list of dropped indexes
xlst= &drp; xprc= &oldpix;
for (xp2= oldpix; xp2; xp2= xp) {
for (xp1= newpix; xp1; xp1= xp1->Next)
if (!stricmp(xp1->Name, xp2->Name))
break; // Index not to drop
if (!xp2) { xp= xp2->GetNext();
// Here we do make the index on tabp
sxp= xp1->GetNext();
xp1->SetNext(NULL);
xp->tabp->MakeIndex(g, xp1, true);
xp1->SetNext(sxp);
} // endif xp2
} // endfor xp1 if (!xp1) {
*xlst= xp2;
*xprc= xp;
*(xlst= &xp2->Next)= NULL;
} else
xprc= &xp2->Next;
// Look for dropped indexes } // endfor xp2
for (xp2= defp2->GetIndx(); xp2; xp2= xp2->GetNext()) {
for (xp1= defp1->GetIndx(); xp1; xp1= xp1->GetNext())
if (!stricmp(xp1->GetName(), xp2->GetName()))
break; // Index not to drop
if (!xp1) { if (drp) {
// Here we erase the index file // Here we erase the index files
sxp= xp2->GetNext(); ddp->DeleteIndexFile(g, drp);
xp2->SetNext(NULL);
defp2->DeleteIndexFile(g, xp2);
xp2->SetNext(sxp);
} // endif xp1 } // endif xp1
} // endfor xp2 } else if (oldpix) {
// TODO: optimize the case of just adding new indexes
if (!newpix)
ddp->DeleteIndexFile(g, NULL);
oldpix= NULL; // To remake all indexes
ddp->SetIndx(NULL);
} // endif sepindex
// Make the list of new created indexes
xlst= &adp; xprc= &newpix;
for (xp1= newpix; xp1; xp1= xp) {
for (xp2= oldpix; xp2; xp2= xp2->Next)
if (!stricmp(xp1->Name, xp2->Name))
break; // Index already made
xp= xp1->Next;
if (!xp2) {
*xlst= xp1;
*xprc= xp;
*(xlst= &xp1->Next)= NULL;
} else
xprc= &xp1->Next;
} // endfor xp1
if (adp)
// Here we do make the new indexes
tdp->MakeIndex(g, adp, true);
} // endif Mode } // endif Mode
} // endelse Xchk
if (CloseTable(g)) if (CloseTable(g))
rc= HA_ERR_INTERNAL_ERROR; rc= HA_ERR_INTERNAL_ERROR;
} // endif tdbp
DBUG_RETURN(rc); DBUG_RETURN(rc);
} // endif MODE_ANY } // endif MODE_ANY
...@@ -3126,7 +3193,8 @@ int ha_connect::external_lock(THD *thd, int lock_type) ...@@ -3126,7 +3193,8 @@ int ha_connect::external_lock(THD *thd, int lock_type)
} else if (newmode == MODE_READ) { } else if (newmode == MODE_READ) {
switch (thd->lex->sql_command) { switch (thd->lex->sql_command) {
case SQLCOM_CREATE_TABLE: case SQLCOM_CREATE_TABLE:
g->Createas= 1; // To tell created table to ignore FLAG xcheck= true;
cras= true;
case SQLCOM_INSERT: case SQLCOM_INSERT:
case SQLCOM_LOAD: case SQLCOM_LOAD:
case SQLCOM_INSERT_SELECT: case SQLCOM_INSERT_SELECT:
...@@ -3142,10 +3210,11 @@ int ha_connect::external_lock(THD *thd, int lock_type) ...@@ -3142,10 +3210,11 @@ int ha_connect::external_lock(THD *thd, int lock_type)
break; break;
case SQLCOM_DROP_INDEX: case SQLCOM_DROP_INDEX:
case SQLCOM_CREATE_INDEX: case SQLCOM_CREATE_INDEX:
case SQLCOM_ALTER_TABLE:
xcheck= true;
// stop= true; // stop= true;
case SQLCOM_DROP_TABLE: case SQLCOM_DROP_TABLE:
case SQLCOM_RENAME_TABLE: case SQLCOM_RENAME_TABLE:
case SQLCOM_ALTER_TABLE:
newmode= MODE_ANY; newmode= MODE_ANY;
break; break;
case SQLCOM_CREATE_VIEW: case SQLCOM_CREATE_VIEW:
...@@ -3170,6 +3239,16 @@ int ha_connect::external_lock(THD *thd, int lock_type) ...@@ -3170,6 +3239,16 @@ int ha_connect::external_lock(THD *thd, int lock_type)
valid_info= false; valid_info= false;
} // endif CheckCleanup } // endif CheckCleanup
if (xcheck) {
// This must occur after CheckCleanup
g->Xchk= new(g) XCHK;
((PCHK)g->Xchk)->oldsep= GetBooleanOption("Sepindex", false);
((PCHK)g->Xchk)->oldpix= GetIndexInfo();
} // endif xcheck
if (cras)
g->Createas= 1; // To tell created table to ignore FLAG
if (xtrace) if (xtrace)
printf("Calling CntCheckDB db=%s\n", GetDBName(NULL)); printf("Calling CntCheckDB db=%s\n", GetDBName(NULL));
...@@ -3691,9 +3770,9 @@ bool ha_connect::pre_create(THD *thd, HA_CREATE_INFO *create_info, ...@@ -3691,9 +3770,9 @@ bool ha_connect::pre_create(THD *thd, HA_CREATE_INFO *create_info,
ok= true; ok= true;
if ((dsn= create_info->connect_string.str)) { if ((dsn= create_info->connect_string.str)) {
PMYDEF mydef= new(g) MYSQLDEF();
PDBUSER dup= PlgGetUser(g); PDBUSER dup= PlgGetUser(g);
PCATLG cat= (dup) ? dup->Catalog : NULL; PCATLG cat= (dup) ? dup->Catalog : NULL;
PMYDEF mydef= new(g) MYSQLDEF();
dsn= (char*)PlugSubAlloc(g, NULL, strlen(dsn) + 1); dsn= (char*)PlugSubAlloc(g, NULL, strlen(dsn) + 1);
strncpy(dsn, create_info->connect_string.str, strncpy(dsn, create_info->connect_string.str,
...@@ -3959,7 +4038,6 @@ int ha_connect::create(const char *name, TABLE *table_arg, ...@@ -3959,7 +4038,6 @@ int ha_connect::create(const char *name, TABLE *table_arg,
Field *fp; Field *fp;
TABTYPE type; TABTYPE type;
TABLE *st= table; // Probably unuseful TABLE *st= table; // Probably unuseful
PIXDEF xdp, pxd= NULL, toidx= NULL;
PGLOBAL g= GetPlug(table_arg->in_use); PGLOBAL g= GetPlug(table_arg->in_use);
DBUG_ENTER("ha_connect::create"); DBUG_ENTER("ha_connect::create");
...@@ -4189,31 +4267,23 @@ int ha_connect::create(const char *name, TABLE *table_arg, ...@@ -4189,31 +4267,23 @@ int ha_connect::create(const char *name, TABLE *table_arg,
} // endif buf } // endif buf
} else { } // endif filename
// Check whether indexes were specified
// Get the index definitions
for (int n= 0; (unsigned)n < table->s->keynames.count; n++) {
if (xtrace)
printf("Getting created index %d info\n", n + 1);
xdp= GetIndexInfo(n); // To check whether indexes have to be made or remade
if (!g->Xchk) {
PIXDEF xdp;
if (pxd) // We should be in CREATE TABLE
pxd->SetNext(xdp); if (table->in_use->lex->sql_command != SQLCOM_CREATE_TABLE)
else push_warning(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
toidx= xdp; "Wrong command in create, please contact CONNECT team");
pxd= xdp;
} // endfor n
if (toidx) { // Get the index definitions
if (xdp= GetIndexInfo()) {
PDBUSER dup= PlgGetUser(g); PDBUSER dup= PlgGetUser(g);
PCATLG cat= (dup) ? dup->Catalog : NULL; PCATLG cat= (dup) ? dup->Catalog : NULL;
DBUG_ASSERT(cat); if (cat) {
if (cat)
cat->SetDataPath(g, table_arg->in_use->db); cat->SetDataPath(g, table_arg->in_use->db);
if ((rc= optimize(NULL, NULL))) { if ((rc= optimize(NULL, NULL))) {
...@@ -4223,9 +4293,14 @@ int ha_connect::create(const char *name, TABLE *table_arg, ...@@ -4223,9 +4293,14 @@ int ha_connect::create(const char *name, TABLE *table_arg,
} else } else
CloseTable(g); CloseTable(g);
} // endif toidx } // endif cat
} // endif filename } // endif xdp
} else {
((PCHK)g->Xchk)->newsep= GetBooleanOption("Sepindex", false);
((PCHK)g->Xchk)->newpix= GetIndexInfo();
} // endif Xchk
table= st; table= st;
} // endif type } // endif type
...@@ -4250,17 +4325,35 @@ bool ha_connect::check_if_incompatible_data(HA_CREATE_INFO *info, ...@@ -4250,17 +4325,35 @@ bool ha_connect::check_if_incompatible_data(HA_CREATE_INFO *info,
{ {
//ha_table_option_struct *param_old, *param_new; //ha_table_option_struct *param_old, *param_new;
DBUG_ENTER("ha_connect::check_if_incompatible_data"); DBUG_ENTER("ha_connect::check_if_incompatible_data");
// TO DO: implement and check it. // TO DO: really implement and check it.
THD *thd= current_thd; THD *thd= current_thd;
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0, push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
"The current version of CONNECT did not check what you changed in ALTER. Use at your own risk"); "The current version of CONNECT did not check what you changed in ALTER. Use at your own risk");
if (table) { if (table) {
PTOS options= info->option_struct; PTOS newopt= info->option_struct;
PTOS oldopt= table->s->option_struct;
#if 0
if (newopt->sepindex != oldopt->sepindex) {
// All indexes to be remade
PGLOBAL g= GetPlug(thd);
if (options->filename) if (!g)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
"Execute OPTIMIZE TABLE to remake the indexes");
else
g->Xchk= new(g) XCHK;
} // endif sepindex
#endif // 0
if (newopt->filename)
DBUG_RETURN(COMPATIBLE_DATA_NO); DBUG_RETURN(COMPATIBLE_DATA_NO);
} // endif table } // endif table
DBUG_RETURN(COMPATIBLE_DATA_YES); DBUG_RETURN(COMPATIBLE_DATA_YES);
} // end of check_if_incompatible_data } // end of check_if_incompatible_data
......
...@@ -48,6 +48,16 @@ typedef struct _xinfo { ...@@ -48,6 +48,16 @@ typedef struct _xinfo {
char *data_file_name; /* Physical file name */ char *data_file_name; /* Physical file name */
} XINFO, *PXF; } XINFO, *PXF;
class XCHK : public BLOCK {
public:
XCHK(void) {oldsep= newsep= false; oldpix= newpix= NULL;}
bool oldsep; // Sepindex before create/alter
bool newsep; // Sepindex after create/alter
PIXDEF oldpix; // The indexes before create/alter
PIXDEF newpix; // The indexes after create/alter
}; // end of class XCHK
typedef class XCHK *PCHK;
typedef class user_connect *PCONNECT; typedef class user_connect *PCONNECT;
typedef struct ha_table_option_struct TOS, *PTOS; typedef struct ha_table_option_struct TOS, *PTOS;
typedef struct ha_field_option_struct FOS, *PFOS; typedef struct ha_field_option_struct FOS, *PFOS;
...@@ -87,11 +97,12 @@ public: ...@@ -87,11 +97,12 @@ public:
char *GetStringOption(char *opname, char *sdef= NULL); char *GetStringOption(char *opname, char *sdef= NULL);
PTOS GetTableOptionStruct(TABLE *table_arg); PTOS GetTableOptionStruct(TABLE *table_arg);
bool GetBooleanOption(char *opname, bool bdef); bool GetBooleanOption(char *opname, bool bdef);
bool SetBooleanOption(char *opname, bool b);
int GetIntegerOption(char *opname); int GetIntegerOption(char *opname);
bool SetIntegerOption(char *opname, int n); bool SetIntegerOption(char *opname, int n);
PFOS GetFieldOptionStruct(Field *fp); PFOS GetFieldOptionStruct(Field *fp);
void *GetColumnOption(void *field, PCOLINFO pcf); void *GetColumnOption(void *field, PCOLINFO pcf);
PIXDEF GetIndexInfo(int n); PIXDEF GetIndexInfo(void);
const char *GetDBName(const char *name); const char *GetDBName(const char *name);
const char *GetTableName(void); const char *GetTableName(void);
int GetColNameLen(Field *fp); int GetColNameLen(Field *fp);
......
...@@ -556,26 +556,8 @@ int MYCAT::GetColCatInfo(PGLOBAL g, PTABDEF defp) ...@@ -556,26 +556,8 @@ int MYCAT::GetColCatInfo(PGLOBAL g, PTABDEF defp)
/***********************************************************************/ /***********************************************************************/
bool MYCAT::GetIndexInfo(PGLOBAL g, PTABDEF defp) bool MYCAT::GetIndexInfo(PGLOBAL g, PTABDEF defp)
{ {
PIXDEF xdp, pxd= NULL, toidx= NULL; // Attach new index(es)
defp->SetIndx(Hc->GetIndexInfo());
// Now take care of the index definitions
for (int n= 0; ; n++) {
if (xtrace)
printf("Getting index %d info\n", n + 1);
if (!(xdp= Hc->GetIndexInfo(n)))
break;
if (pxd)
pxd->SetNext(xdp);
else
toidx= xdp;
pxd= xdp;
} // endfor n
// All is correct, attach new index(es)
defp->SetIndx(toidx);
return false; return false;
} // end of GetIndexInfo } // end of GetIndexInfo
......
...@@ -152,6 +152,7 @@ PGLOBAL PlugInit(LPCSTR Language, uint worksize) ...@@ -152,6 +152,7 @@ PGLOBAL PlugInit(LPCSTR Language, uint worksize)
g->Trace = 0; g->Trace = 0;
g->Createas = 0; g->Createas = 0;
g->Activityp = g->ActivityStart = NULL; g->Activityp = g->ActivityStart = NULL;
g->Xchk = NULL;
strcpy(g->Message, ""); strcpy(g->Message, "");
/*******************************************************************/ /*******************************************************************/
......
...@@ -157,13 +157,13 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf) ...@@ -157,13 +157,13 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf)
char filename[_MAX_PATH]; char filename[_MAX_PATH];
bool sep, rc = false; bool sep, rc = false;
if (!pxdf) if (!To_Indx)
return false; // No index return false; // No index
// If true indexes are in separate files // If true indexes are in separate files
sep = Cat->GetBoolCatInfo("SepIndex", false); sep = Cat->GetBoolCatInfo("SepIndex", false);
if (!sep && To_Indx) { if (!sep && pxdf) {
strcpy(g->Message, MSG(NO_RECOV_SPACE)); strcpy(g->Message, MSG(NO_RECOV_SPACE));
return true; return true;
} // endif sep } // endif sep
...@@ -204,7 +204,7 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf) ...@@ -204,7 +204,7 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf)
#endif // UNIX #endif // UNIX
} // endfor pxdf } // endfor pxdf
} else { // !sep, no more indexes or name is NULL } else { // !sep
// Drop all indexes, delete the common file // Drop all indexes, delete the common file
PlugSetPath(filename, Ofn, GetPath()); PlugSetPath(filename, Ofn, GetPath());
strcat(PlugRemoveType(filename, filename), ftype); strcat(PlugRemoveType(filename, filename), ftype);
......
...@@ -70,7 +70,6 @@ user_connect::user_connect(THD *thd, const char *dbn) ...@@ -70,7 +70,6 @@ user_connect::user_connect(THD *thd, const char *dbn)
next= NULL; next= NULL;
previous= NULL; previous= NULL;
g= NULL; g= NULL;
tabp= NULL;
last_query_id= 0; last_query_id= 0;
count= 0; count= 0;
...@@ -141,6 +140,8 @@ bool user_connect::CheckCleanup(void) ...@@ -141,6 +140,8 @@ bool user_connect::CheckCleanup(void)
if (thdp->query_id > last_query_id) { if (thdp->query_id > last_query_id) {
PlugCleanup(g, true); PlugCleanup(g, true);
PlugSubSet(g, g->Sarea, g->Sarea_Size); PlugSubSet(g, g->Sarea, g->Sarea_Size);
g->Xchk = NULL;
g->Createas = 0;
last_query_id= thdp->query_id; last_query_id= thdp->query_id;
if (xtrace) if (xtrace)
......
...@@ -70,7 +70,6 @@ protected: ...@@ -70,7 +70,6 @@ protected:
PCONNECT previous; // Previous user in chain PCONNECT previous; // Previous user in chain
PGLOBAL g; // The common handle to CONNECT PGLOBAL g; // The common handle to CONNECT
//char dbname[32]; // The DBCONNECT database //char dbname[32]; // The DBCONNECT database
PTDBDOS tabp; // The table used on create
query_id_t last_query_id; // the latest user query id query_id_t last_query_id; // the latest user query id
int count; // if used by several handlers int count; // if used by several handlers
// Statistics // Statistics
......
...@@ -76,6 +76,7 @@ typedef struct index_off { ...@@ -76,6 +76,7 @@ typedef struct index_off {
class DllExport INDEXDEF : public BLOCK { /* Index description block */ class DllExport INDEXDEF : public BLOCK { /* Index description block */
friend class PLUGCAT; friend class PLUGCAT;
friend class DOSDEF; friend class DOSDEF;
friend class ha_connect;
friend int PlgMakeIndex(PGLOBAL g, PSZ name, PIXDEF pxdf, bool add); friend int PlgMakeIndex(PGLOBAL g, PSZ name, PIXDEF pxdf, bool add);
public: public:
// Constructor // Constructor
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment