Skip to content

Commit 60c9485

Browse files
committed
Merge connect/10.0 into 10.0
Squash all connect/10.0's commits into one and keep only changes from storage/connect directory.
1 parent 31f4df4 commit 60c9485

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1001
-482
lines changed

storage/connect/array.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ bool ARRAY::FilTest(PGLOBAL g, PVAL valp, OPVAL opc, int opm)
520520

521521
} else if (opc != OP_EXIST) {
522522
sprintf(g->Message, MSG(MISSING_ARG), opc);
523-
throwTYPE_ARRAY;
523+
throw (int)TYPE_ARRAY;
524524
} else // OP_EXIST
525525
return Nval > 0;
526526

@@ -683,14 +683,14 @@ void ARRAY::SetPrecision(PGLOBAL g, int p)
683683
{
684684
if (Vblp == NULL) {
685685
strcpy(g->Message, MSG(PREC_VBLP_NULL));
686-
throw TYPE_ARRAY;
686+
throw (int)TYPE_ARRAY;
687687
} // endif Vblp
688688

689689
bool was = Vblp->IsCi();
690690

691691
if (was && !p) {
692692
strcpy(g->Message, MSG(BAD_SET_CASE));
693-
throw TYPE_ARRAY;
693+
throw (int)TYPE_ARRAY;
694694
} // endif Vblp
695695

696696
if (was || !p)
@@ -701,7 +701,7 @@ void ARRAY::SetPrecision(PGLOBAL g, int p)
701701
if (!was && Type == TYPE_STRING)
702702
// Must be resorted to eliminate duplicate strings
703703
if (Sort(g))
704-
throw TYPE_ARRAY;
704+
throw (int)TYPE_ARRAY;
705705

706706
} // end of SetPrecision
707707

@@ -1035,7 +1035,7 @@ void ARRAY::Printf(PGLOBAL g, FILE *f, uint n)
10351035
} else
10361036
fprintf(f, "%sVALLST: numval=%d\n", m, Nval);
10371037

1038-
} // end of Print
1038+
} // end of Printf
10391039

10401040
/***********************************************************************/
10411041
/* Make string output of ARRAY contents. */
@@ -1047,7 +1047,7 @@ void ARRAY::Prints(PGLOBAL, char *ps, uint z)
10471047

10481048
sprintf(ps, "ARRAY: type=%d\n", Type);
10491049
// More to be implemented later
1050-
} // end of Print
1050+
} // end of Prints
10511051

10521052
/* -------------------------- Class MULAR ---------------------------- */
10531053

storage/connect/blkfil.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ void BLOCKFILTER::Printf(PGLOBAL, FILE *f, uint n)
6565

6666
fprintf(f, "%sBLOCKFILTER: at %p opc=%d opm=%d result=%d\n",
6767
m, this, Opc, Opm, Result);
68-
} // end of Print
68+
} // end of Printf
6969

7070
/***********************************************************************/
7171
/* Make string output of BLOCKFILTER contents. */
7272
/***********************************************************************/
7373
void BLOCKFILTER::Prints(PGLOBAL, char *ps, uint z)
7474
{
7575
strncat(ps, "BlockFilter(s)", z);
76-
} // end of Print
76+
} // end of Prints
7777

7878

7979
/* ---------------------- Class BLKFILLOG ---------------------------- */
@@ -1006,17 +1006,17 @@ void BLOCKINDEX::Printf(PGLOBAL g, FILE *f, UINT n)
10061006
m, this, Next, (Colp) ? Colp->GetName() : "Rowid", Kxp, Result);
10071007

10081008
if (Next)
1009-
Next->Print(g, f, n);
1009+
Next->Printf(g, f, n);
10101010

1011-
} // end of Print
1011+
} // end of Printf
10121012

10131013
/***********************************************************************/
10141014
/* Make string output of BLOCKINDEX contents. */
10151015
/***********************************************************************/
10161016
void BLOCKINDEX::Prints(PGLOBAL g, char *ps, UINT z)
10171017
{
10181018
strncat(ps, "BlockIndex(es)", z);
1019-
} // end of Print
1019+
} // end of Prints
10201020

10211021
/* ------------------------------------------------------------------- */
10221022

storage/connect/colblk.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ int COLBLK::GetLengthEx(void)
197197
void COLBLK::ReadColumn(PGLOBAL g)
198198
{
199199
sprintf(g->Message, MSG(UNDEFINED_AM), "ReadColumn");
200-
throw TYPE_COLBLK;
200+
throw (int)TYPE_COLBLK;
201201
} // end of ReadColumn
202202

203203
/***********************************************************************/
@@ -208,7 +208,7 @@ void COLBLK::ReadColumn(PGLOBAL g)
208208
void COLBLK::WriteColumn(PGLOBAL g)
209209
{
210210
sprintf(g->Message, MSG(UNDEFINED_AM), "WriteColumn");
211-
throw TYPE_COLBLK;
211+
throw (int)TYPE_COLBLK;
212212
} // end of WriteColumn
213213

214214
/***********************************************************************/
@@ -232,15 +232,15 @@ void COLBLK::Printf(PGLOBAL, FILE *f, uint n)
232232
fprintf(f,
233233
" coluse=%04X status=%04X buftyp=%d value=%p name=%s\n",
234234
ColUse, Status, Buf_Type, Value, Name);
235-
} // end of Print
235+
} // end of Printf
236236

237237
/***********************************************************************/
238238
/* Make string output of a column descriptor block. */
239239
/***********************************************************************/
240240
void COLBLK::Prints(PGLOBAL, char *ps, uint)
241241
{
242242
sprintf(ps, "R%d.%s", To_Tdb->GetTdb_No(), Name);
243-
} // end of Print
243+
} // end of Prints
244244

245245

246246
/***********************************************************************/
@@ -262,7 +262,7 @@ SPCBLK::SPCBLK(PCOLUMN cp)
262262
void SPCBLK::WriteColumn(PGLOBAL g)
263263
{
264264
sprintf(g->Message, MSG(SPCOL_READONLY), Name);
265-
throw TYPE_COLBLK;
265+
throw (int)TYPE_COLBLK;
266266
} // end of WriteColumn
267267

268268
/***********************************************************************/

storage/connect/connect.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* Copyright (C) Olivier Bertrand 2004 - 2017
2+
Copyright (C) MariaDB Corporation Ab
23
34
This program is free software; you can redistribute it and/or modify
45
it under the terms of the GNU General Public License as published by
@@ -66,8 +67,10 @@ PGLOBAL CntExit(PGLOBAL g)
6667
if (g) {
6768
CntEndDB(g);
6869

69-
if (g->Activityp)
70-
delete g->Activityp;
70+
if (g->Activityp) {
71+
delete g->Activityp;
72+
g->Activityp = NULL;
73+
}// endif Activityp
7174

7275
PlugExit(g);
7376
g= NULL;
@@ -185,10 +188,10 @@ bool CntInfo(PGLOBAL g, PTDB tp, PXF info)
185188
/***********************************************************************/
186189
PTDB CntGetTDB(PGLOBAL g, LPCSTR name, MODE mode, PHC h)
187190
{
188-
PTDB tdbp;
191+
PTDB tdbp = NULL;
189192
PTABLE tabp;
190193
PDBUSER dup = PlgGetUser(g);
191-
volatile PCATLG cat = (dup) ? dup->Catalog : NULL; // Safe over longjmp
194+
volatile PCATLG cat = (dup) ? dup->Catalog : NULL; // Safe over throw
192195

193196
if (trace)
194197
printf("CntGetTDB: name=%s mode=%d cat=%p\n", name, mode, cat);

storage/connect/connect.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) Olivier Bertrand 2004 - 2011
1+
/* Copyright (C) MariaDB Corporation Ab
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -15,6 +15,7 @@
1515

1616
/**************** Cnt H Declares Source Code File (.H) *****************/
1717
/* Name: CONNECT.H Version 2.4 */
18+
/* Author Olivier BERTRAND bertrandop@gmail.com */
1819
/* This file contains the some based classes declares. */
1920
/***********************************************************************/
2021
#include "filamtxt.h"

storage/connect/engmsg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* Copyright (C) MariaDB Corporation Ab */
12
#define MSG_ACCESS_VIOLATN "Access violation"
23
#define MSG_ADD_BAD_TYPE "Array add value type mismatch (%s -> %s)"
34
#define MSG_ALLOC_ERROR "Error allocating %s"

storage/connect/filter.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ BYTE OpBmp(PGLOBAL g, OPVAL opc)
8787
case OP_EXIST: bt = 0x00; break;
8888
default:
8989
sprintf(g->Message, MSG(BAD_FILTER_OP), opc);
90-
throw TYPE_ARRAY;
90+
throw (int)TYPE_FILTER;
9191
} // endswitch opc
9292

9393
return bt;
@@ -1437,7 +1437,7 @@ void FILTER::Printf(PGLOBAL g, FILE *f, uint n)
14371437

14381438
} // endfor fp
14391439

1440-
} // end of Print
1440+
} // end of Printf
14411441

14421442
/***********************************************************************/
14431443
/* Make string output of TABLE contents (z should be checked). */
@@ -1579,7 +1579,7 @@ void FILTER::Prints(PGLOBAL g, char *ps, uint z)
15791579
bcp = bxp;
15801580
} while (bcp); // enddo
15811581

1582-
} // end of Print
1582+
} // end of Prints
15831583

15841584

15851585
/* -------------------- Derived Classes Functions -------------------- */
@@ -1697,8 +1697,6 @@ PFIL PrepareFilter(PGLOBAL g, PFIL fp, bool having)
16971697

16981698
if (trace)
16991699
htrc("PrepareFilter: fp=%p having=%d\n", fp, having);
1700-
//if (fp)
1701-
// fp->Print(g, debug, 0);
17021700

17031701
while (fp) {
17041702
if (fp->Opc == OP_SEP)
@@ -1712,7 +1710,7 @@ PFIL PrepareFilter(PGLOBAL g, PFIL fp, bool having)
17121710
break; // Remove eventual ending separator(s)
17131711

17141712
// if (fp->Convert(g, having))
1715-
// throw TYPE_ARRAY;
1713+
// throw (int)TYPE_FILTER;
17161714

17171715
filp = fp;
17181716
fp = fp->Next;
@@ -1721,8 +1719,6 @@ PFIL PrepareFilter(PGLOBAL g, PFIL fp, bool having)
17211719

17221720
if (trace)
17231721
htrc(" returning filp=%p\n", filp);
1724-
//if (filp)
1725-
// filp->Print(g, debug, 0);
17261722

17271723
return filp;
17281724
} // end of PrepareFilter
@@ -1745,7 +1741,7 @@ DllExport bool ApplyFilter(PGLOBAL g, PFIL filp)
17451741
// return TRUE;
17461742

17471743
if (filp->Eval(g))
1748-
throw TYPE_FILTER;
1744+
throw (int)TYPE_FILTER;
17491745

17501746
if (trace > 1)
17511747
htrc("PlugFilter filp=%p result=%d\n",

storage/connect/global.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/***********************************************************************/
22
/* GLOBAL.H: Declaration file used by all CONNECT implementations. */
3-
/* (C) Copyright Olivier Bertrand 1993-2017 */
3+
/* (C) Copyright MariaDB Corporation Ab */
4+
/* Author Olivier Bertrand 1993-2017 */
45
/***********************************************************************/
56

67
/***********************************************************************/
@@ -90,6 +91,7 @@
9091
#define TYPE_BIGINT 5
9192
#define TYPE_LIST 6
9293
#define TYPE_INT 7
94+
#define TYPE_DATE 8
9395
#define TYPE_DECIM 9
9496
#define TYPE_BIN 10
9597
#define TYPE_PCHAR 11

0 commit comments

Comments
 (0)