1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

- Add a new CONNECT global variable allowing to tell whether or not

a temporary file should be used for UPDATE/DELETE of file tables.
  Also use the "sorted" argument of index_init to help decide if
  sorting of positions must be done.
modified:
  storage/connect/checklvl.h
  storage/connect/connect.cc
  storage/connect/connect.h
  storage/connect/filamdbf.cpp
  storage/connect/filamfix.cpp
  storage/connect/filamfix.h
  storage/connect/filamtxt.cpp
  storage/connect/ha_connect.cc
  storage/connect/mysql-test/connect/r/part_table.result
  storage/connect/plgdbsem.h
  storage/connect/plgdbutl.cpp
  storage/connect/reldef.cpp
  storage/connect/tabdos.cpp
  storage/connect/tabdos.h
  storage/connect/tabfix.cpp
  storage/connect/tabfmt.cpp
  storage/connect/tabvct.cpp
  storage/connect/tabvct.h
  storage/connect/xindex.cpp

- Fix a bug in TDBASE::ColDB that caused some special columns not to
  be found in the column list and reallocated without their Value
  causing a crash of some queries.
modified:
  storage/connect/table.cpp

- Fix a bug causing RestoreNrec to be called before closing a table
  causing a wrong value given to Spos
modified:
  storage/connect/tabdos.cpp
  storage/connect/xindex.cpp

- Add a new CONNECT global variable connect_exact_info. Set to ON, it
  tells CONNECT to return exact record numbers on info queries. If OFF
  it just gives an estimate. In version 10.0.13 this was unconditionally
  ON and caused info queries on remote tables to be extremely long and
  was the subject of MDEV-6612.
modified:
  storage/connect/ha_connect.cc
  storage/connect/tabdos.cpp
  storage/connect/tabmysql.cpp
  storage/connect/tabodbc.cpp
This commit is contained in:
Olivier Bertrand
2014-08-22 17:30:22 +02:00
parent 8b9ed85b8a
commit f930f4eda9
25 changed files with 396 additions and 250 deletions

View File

@@ -51,7 +51,9 @@
/***********************************************************************/
/* DB static variables. */
/***********************************************************************/
extern "C" int trace;
extern "C" int trace;
extern "C" USETEMP Use_Temp;
extern int num_read, num_there, num_eq[2]; // Statistics
static const longlong M2G = 0x80000000;
static const longlong M4G = (longlong)2 * M2G;
@@ -135,6 +137,10 @@ int TDBFIX::ResetTableOpt(PGLOBAL g, bool dop, bool dox)
MaxSize = -1; // Size must be recalculated
Cardinal = -1; // as well as Cardinality
// After the table was modified the indexes
// are invalid and we should mark them as such...
rc = ((PDOSDEF)To_Def)->InvalidateIndex(g);
if (dop) {
Columns = NULL; // Not used anymore
Txfp->Reset();
@@ -153,12 +159,8 @@ int TDBFIX::ResetTableOpt(PGLOBAL g, bool dop, bool dox)
Mode = MODE_READ; // New mode
prc = rc;
if (!(PlgGetUser(g)->Check & CHK_OPT)) {
// After the table was modified the indexes
// are invalid and we should mark them as such...
rc = ((PDOSDEF)To_Def)->InvalidateIndex(g);
} else
// ... or we should remake them.
if (PlgGetUser(g)->Check & CHK_OPT)
// We must remake indexes.
rc = MakeIndex(g, NULL, FALSE);
rc = (rc == RC_INFO) ? prc : rc;
@@ -269,9 +271,11 @@ int TDBFIX::RowNumber(PGLOBAL g, bool b)
/***********************************************************************/
bool TDBFIX::IsUsingTemp(PGLOBAL g)
{
USETEMP usetemp = PlgGetUser(g)->UseTemp;
return (usetemp == TMP_YES || usetemp == TMP_FORCE);
// Not ready yet to handle using a temporary file with mapping
// or while deleting from DBF files.
return ((Use_Temp == TMP_YES && Txfp->GetAmType() != TYPE_AM_MAP &&
!(Mode == MODE_DELETE && Txfp->GetAmType() == TYPE_AM_DBF)) ||
Use_Temp == TMP_FORCE || Use_Temp == TMP_TEST);
} // end of IsUsingTemp
/***********************************************************************/
@@ -302,8 +306,9 @@ bool TDBFIX::OpenDB(PGLOBAL g)
return false;
} // endif use
if (Mode == MODE_DELETE && !Next && Txfp->GetAmType() == TYPE_AM_MAP) {
// Delete all lines. Not handled in MAP mode
if (Mode == MODE_DELETE && Txfp->GetAmType() == TYPE_AM_MAP &&
(!Next || Use_Temp == TMP_FORCE)) {
// Delete all lines or using temp. Not handled in MAP mode
Txfp = new(g) FIXFAM((PDOSDEF)To_Def);
Txfp->SetTdbp(this);
} // endif Mode