Commit b781d290 authored by Olivier Bertrand's avatar Olivier Bertrand

commit git 167, 168 and 169 msg

parent 24f5bbac
...@@ -4062,6 +4062,11 @@ int ha_connect::info(uint flag) ...@@ -4062,6 +4062,11 @@ int ha_connect::info(uint flag)
DBUG_ENTER("ha_connect::info"); DBUG_ENTER("ha_connect::info");
if (!g) {
my_message(ER_UNKNOWN_ERROR, "Cannot get g pointer", MYF(0));
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
} // endif g
if (trace) if (trace)
htrc("%p In info: flag=%u valid_info=%d\n", this, flag, valid_info); htrc("%p In info: flag=%u valid_info=%d\n", this, flag, valid_info);
......
...@@ -10,4 +10,4 @@ let $SECUREDIR= `select @@secure_file_priv`; ...@@ -10,4 +10,4 @@ let $SECUREDIR= `select @@secure_file_priv`;
INSERT INTO t1 VALUES (10); INSERT INTO t1 VALUES (10);
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
--remove_file $SECUREDIR/t1.dbf --remove_file $MYSQL_TMP_DIR/t1.dbf
...@@ -1646,7 +1646,7 @@ int TDBDOS::TestBlock(PGLOBAL g) ...@@ -1646,7 +1646,7 @@ int TDBDOS::TestBlock(PGLOBAL g)
/***********************************************************************/ /***********************************************************************/
int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add) int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add)
{ {
int k, n; int k, n, rc = RC_OK;
bool fixed, doit, sep, b = (pxdf != NULL); bool fixed, doit, sep, b = (pxdf != NULL);
PCOL *keycols, colp; PCOL *keycols, colp;
PIXDEF xdp, sxp = NULL; PIXDEF xdp, sxp = NULL;
...@@ -1691,6 +1691,7 @@ int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add) ...@@ -1691,6 +1691,7 @@ int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add)
} else if (!(pxdf = dfp->GetIndx())) } else if (!(pxdf = dfp->GetIndx()))
return RC_INFO; // No index to make return RC_INFO; // No index to make
try {
// Allocate all columns that will be used by indexes. // Allocate all columns that will be used by indexes.
// This must be done before opening the table so specific // This must be done before opening the table so specific
// column initialization can be done (in particular by TDBVCT) // column initialization can be done (in particular by TDBVCT)
...@@ -1757,7 +1758,7 @@ int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add) ...@@ -1757,7 +1758,7 @@ int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add)
if (!x->Make(g, sxp)) { if (!x->Make(g, sxp)) {
// Retreive define values from the index // Retreive define values from the index
xdp->SetMaxSame(x->GetMaxSame()); xdp->SetMaxSame(x->GetMaxSame());
// xdp->SetSize(x->GetSize()); // xdp->SetSize(x->GetSize());
// store KXYCOL Mxs in KPARTDEF Mxsame // store KXYCOL Mxs in KPARTDEF Mxsame
xdp->SetMxsame(x); xdp->SetMxsame(x);
...@@ -1766,7 +1767,7 @@ int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add) ...@@ -1766,7 +1767,7 @@ int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add)
printf("Make done...\n"); printf("Make done...\n");
#endif // TRACE #endif // TRACE
// if (x->GetSize() > 0) // if (x->GetSize() > 0)
sxp = xdp; sxp = xdp;
xdp->SetInvalid(false); xdp->SetInvalid(false);
...@@ -1776,10 +1777,19 @@ int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add) ...@@ -1776,10 +1777,19 @@ int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add)
} else } else
return RC_INFO; // Error or Physical table does not exist return RC_INFO; // Error or Physical table does not exist
} catch (int n) {
if (trace)
htrc("Exception %d: %s\n", n, g->Message);
rc = RC_FX;
} catch (const char *msg) {
strcpy(g->Message, msg);
rc = RC_FX;
} // end catch
if (Use == USE_OPEN) if (Use == USE_OPEN)
CloseDB(g); CloseDB(g);
return RC_OK; return rc;
err: err:
if (sxp) if (sxp)
......
...@@ -464,7 +464,7 @@ bool XINDEX::Make(PGLOBAL g, PIXDEF sxp) ...@@ -464,7 +464,7 @@ bool XINDEX::Make(PGLOBAL g, PIXDEF sxp)
if (ApplyFilter(g, filp)) if (ApplyFilter(g, filp))
break; break;
// passthru // fall through
case RC_NF: case RC_NF:
continue; continue;
case RC_EF: case RC_EF:
...@@ -3009,6 +3009,7 @@ KXYCOL::KXYCOL(PKXBASE kp) : To_Keys(Keys.Memp), ...@@ -3009,6 +3009,7 @@ KXYCOL::KXYCOL(PKXBASE kp) : To_Keys(Keys.Memp),
bool KXYCOL::Init(PGLOBAL g, PCOL colp, int n, bool sm, int kln) bool KXYCOL::Init(PGLOBAL g, PCOL colp, int n, bool sm, int kln)
{ {
int len = colp->GetLength(), prec = colp->GetScale(); int len = colp->GetLength(), prec = colp->GetScale();
bool un = colp->IsUnsigned();
// Currently no indexing on NULL columns // Currently no indexing on NULL columns
if (colp->IsNullable() && kln) { if (colp->IsNullable() && kln) {
...@@ -3028,7 +3029,7 @@ bool KXYCOL::Init(PGLOBAL g, PCOL colp, int n, bool sm, int kln) ...@@ -3028,7 +3029,7 @@ bool KXYCOL::Init(PGLOBAL g, PCOL colp, int n, bool sm, int kln)
// Allocate the Value object used when moving items // Allocate the Value object used when moving items
Type = colp->GetResultType(); Type = colp->GetResultType();
if (!(Valp = AllocateValue(g, Type, len, prec, colp->IsUnsigned()))) if (!(Valp = AllocateValue(g, Type, len, prec, un)))
return true; return true;
Klen = Valp->GetClen(); Klen = Valp->GetClen();
...@@ -3044,7 +3045,7 @@ bool KXYCOL::Init(PGLOBAL g, PCOL colp, int n, bool sm, int kln) ...@@ -3044,7 +3045,7 @@ bool KXYCOL::Init(PGLOBAL g, PCOL colp, int n, bool sm, int kln)
// Currently we set it to true to be compatible with QRY blocks, // Currently we set it to true to be compatible with QRY blocks,
// and the one before last is to enable length/type checking, set to // and the one before last is to enable length/type checking, set to
// true if not a prefix key. // true if not a prefix key.
Kblp = AllocValBlock(g, To_Keys, Type, n, len, prec, !Prefix, true); Kblp = AllocValBlock(g, To_Keys, Type, n, len, prec, !Prefix, true, un);
Asc = sm; // Sort mode: Asc=true Desc=false Asc = sm; // Sort mode: Asc=true Desc=false
Ndf = n; Ndf = n;
...@@ -3065,6 +3066,7 @@ bool KXYCOL::Init(PGLOBAL g, PCOL colp, int n, bool sm, int kln) ...@@ -3065,6 +3066,7 @@ bool KXYCOL::Init(PGLOBAL g, PCOL colp, int n, bool sm, int kln)
BYTE* KXYCOL::MapInit(PGLOBAL g, PCOL colp, int *n, BYTE *m) BYTE* KXYCOL::MapInit(PGLOBAL g, PCOL colp, int *n, BYTE *m)
{ {
int len = colp->GetLength(), prec = colp->GetScale(); int len = colp->GetLength(), prec = colp->GetScale();
bool un = colp->IsUnsigned();
if (n[3] && colp->GetLength() > n[3] if (n[3] && colp->GetLength() > n[3]
&& colp->GetResultType() == TYPE_STRING) { && colp->GetResultType() == TYPE_STRING) {
...@@ -3079,7 +3081,7 @@ BYTE* KXYCOL::MapInit(PGLOBAL g, PCOL colp, int *n, BYTE *m) ...@@ -3079,7 +3081,7 @@ BYTE* KXYCOL::MapInit(PGLOBAL g, PCOL colp, int *n, BYTE *m)
this, colp, Type, n[0], len, m); this, colp, Type, n[0], len, m);
// Allocate the Value object used when moving items // Allocate the Value object used when moving items
Valp = AllocateValue(g, Type, len, prec, colp->IsUnsigned()); Valp = AllocateValue(g, Type, len, prec, un);
Klen = Valp->GetClen(); Klen = Valp->GetClen();
if (n[2]) { if (n[2]) {
...@@ -3088,7 +3090,7 @@ BYTE* KXYCOL::MapInit(PGLOBAL g, PCOL colp, int *n, BYTE *m) ...@@ -3088,7 +3090,7 @@ BYTE* KXYCOL::MapInit(PGLOBAL g, PCOL colp, int *n, BYTE *m)
Bkeys.Sub = true; Bkeys.Sub = true;
// Allocate the Valblk containing initial block key values // Allocate the Valblk containing initial block key values
Blkp = AllocValBlock(g, To_Bkeys, Type, n[2], len, prec, true, true); Blkp = AllocValBlock(g, To_Bkeys, Type, n[2], len, prec, true, true, un);
} // endif nb } // endif nb
Keys.Size = n[0] * Klen; Keys.Size = n[0] * Klen;
...@@ -3099,7 +3101,7 @@ BYTE* KXYCOL::MapInit(PGLOBAL g, PCOL colp, int *n, BYTE *m) ...@@ -3099,7 +3101,7 @@ BYTE* KXYCOL::MapInit(PGLOBAL g, PCOL colp, int *n, BYTE *m)
// by blanks (if true) or keep the zero ending char (if false). // by blanks (if true) or keep the zero ending char (if false).
// Currently we set it to true to be compatible with QRY blocks, // Currently we set it to true to be compatible with QRY blocks,
// and last one to enable type checking (no conversion). // and last one to enable type checking (no conversion).
Kblp = AllocValBlock(g, To_Keys, Type, n[0], len, prec, !Prefix, true); Kblp = AllocValBlock(g, To_Keys, Type, n[0], len, prec, !Prefix, true, un);
if (n[1]) { if (n[1]) {
Koff.Size = n[1] * sizeof(int); Koff.Size = n[1] * sizeof(int);
......
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