mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
- Save and restore srcdef when getting a sub-table (could stay in cache)
modified: storage/connect/tabutil.cpp - Change order of tests when looking for valid tdbp. In rare cases an invalid tdbp was still existing causing a crash of the server. modified: storage/connect/ha_connect.cc
This commit is contained in:
@ -313,6 +313,7 @@ TDBPRX::TDBPRX(PPRXDEF tdp) : TDBASE(tdp)
|
||||
/***********************************************************************/
|
||||
PTDBASE TDBPRX::GetSubTable(PGLOBAL g, PTABLE tabp, bool b)
|
||||
{
|
||||
const char *sp;
|
||||
char *db, *name;
|
||||
bool mysql = true;
|
||||
PTDB tdbp = NULL;
|
||||
@ -349,6 +350,9 @@ PTDBASE TDBPRX::GetSubTable(PGLOBAL g, PTABLE tabp, bool b)
|
||||
// Don't use caller's columns
|
||||
fp = hc->get_table()->field;
|
||||
hc->get_table()->field = NULL;
|
||||
|
||||
// Make caller use the source definition
|
||||
sp = hc->get_table()->s->option_struct->srcdef;
|
||||
hc->get_table()->s->option_struct->srcdef = tabp->GetSrc();
|
||||
} // endif srcdef
|
||||
|
||||
@ -379,8 +383,11 @@ PTDBASE TDBPRX::GetSubTable(PGLOBAL g, PTABLE tabp, bool b)
|
||||
s->field = NULL;
|
||||
|
||||
hc->tshp = NULL;
|
||||
} else if (b)
|
||||
} else if (b) {
|
||||
// Restore s structure that can be in cache
|
||||
hc->get_table()->field = fp;
|
||||
hc->get_table()->s->option_struct->srcdef = sp;
|
||||
} // endif s
|
||||
|
||||
if (trace && tdbp)
|
||||
htrc("Subtable %s in %s\n",
|
||||
|
Reference in New Issue
Block a user