Skip to content

Commit 546773f

Browse files
committed
Merge branch 'ob-10.1' into 10.1
2 parents 3bd6e68 + 762111e commit 546773f

File tree

10 files changed

+33
-45
lines changed

10 files changed

+33
-45
lines changed

storage/connect/domdoc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ DOMDOC::DOMDOC(char *nsl, char *nsdf, char *enc, PFBLOCK fp)
8484
: XMLDOCUMENT(nsl, nsdf, enc)
8585
{
8686
assert (!fp || fp->Type == TYPE_FB_XML);
87-
Docp = (fp) ? ((PXBLOCK)fp)->Docp : NULL;
88-
Nlist = NULL;
87+
Docp = (fp) ? ((PXBLOCK)fp)->Docp : (MSXML2::IXMLDOMDocumentPtr)NULL;
88+
Nlist = NULL;
8989
Hr = 0;
9090
} // end of DOMDOC constructor
9191

storage/connect/filamtxt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ int TXTFAM::DeleteSortedRows(PGLOBAL g)
427427

428428
for (i = 0; i < Posar->GetNval(); i++) {
429429
if ((irc = InitDelete(g, Posar->GetIntValue(ix[i]),
430-
Sosar->GetIntValue(ix[i])) == RC_FX))
430+
Sosar->GetIntValue(ix[i]))) == RC_FX)
431431
goto err;
432432

433433
// Now delete the sorted rows

storage/connect/ha_connect.cc

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,9 @@
107107

108108
#define MYSQL_SERVER 1
109109
#define DONT_DEFINE_VOID
110-
#include "sql_class.h"
111-
#include "create_options.h"
112-
#include "mysql_com.h"
113-
#include "field.h"
110+
#include <my_global.h>
114111
#include "sql_parse.h"
115112
#include "sql_base.h"
116-
#include <sys/stat.h>
117113
#include "sql_partition.h"
118114
#undef OFFSET
119115

@@ -432,7 +428,7 @@ handlerton *connect_hton= NULL;
432428
uint GetTraceValue(void)
433429
{return (uint)(connect_hton ? THDVAR(current_thd, xtrace) : 0);}
434430
bool ExactInfo(void) {return THDVAR(current_thd, exact_info);}
435-
bool CondPushEnabled(void) {return THDVAR(current_thd, cond_push);}
431+
static bool CondPushEnabled(void) {return THDVAR(current_thd, cond_push);}
436432
USETEMP UseTemp(void) {return (USETEMP)THDVAR(current_thd, use_tempfile);}
437433
int GetConvSize(void) {return THDVAR(current_thd, conv_size);}
438434
TYPCONV GetTypeConv(void) {return (TYPCONV)THDVAR(current_thd, type_conv);}
@@ -1781,12 +1777,14 @@ bool ha_connect::CheckVirtualIndex(TABLE_SHARE *s)
17811777

17821778
bool ha_connect::IsPartitioned(void)
17831779
{
1784-
if (tshp)
1780+
#ifdef WITH_PARTITION_STORAGE_ENGINE
1781+
if (tshp)
17851782
return tshp->partition_info_str_len > 0;
17861783
else if (table && table->part_info)
17871784
return true;
17881785
else
1789-
return false;
1786+
#endif
1787+
return false;
17901788

17911789
} // end of IsPartitioned
17921790

@@ -2811,7 +2809,7 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
28112809
htrc("Cond type=%d\n", cond->type());
28122810

28132811
if (cond->type() == COND::COND_ITEM) {
2814-
char *pb0, *pb1, *pb2, *ph0, *ph1, *ph2;
2812+
char *pb0, *pb1, *pb2, *ph0= 0, *ph1= 0, *ph2= 0;
28152813
bool bb = false, bh = false;
28162814
Item_cond *cond_item= (Item_cond *)cond;
28172815

@@ -5568,7 +5566,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
55685566
} // endif p
55695567

55705568
} else if (ttp != TAB_ODBC || !(fnc & (FNC_TABLE | FNC_COL)))
5571-
tab = table_s->table_name.str; // Default value
5569+
tab = (char*)table_s->table_name.str; // Default value
55725570

55735571
} // endif tab
55745572

@@ -6200,7 +6198,9 @@ int ha_connect::create(const char *name, TABLE *table_arg,
62006198
LEX_STRING cnc = table_arg->s->connect_string;
62016199
#if defined(WITH_PARTITION_STORAGE_ENGINE)
62026200
partition_info *part_info= table_arg->part_info;
6203-
#endif // WITH_PARTITION_STORAGE_ENGINE
6201+
#else // !WITH_PARTITION_STORAGE_ENGINE
6202+
#define part_info 0
6203+
#endif // !WITH_PARTITION_STORAGE_ENGINE
62046204
xp= GetUser(thd, xp);
62056205
PGLOBAL g= xp->g;
62066206

@@ -6301,9 +6301,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
63016301

63026302
// fall through
63036303
case TAB_MYSQL:
6304-
#if defined(WITH_PARTITION_STORAGE_ENGINE)
63056304
if (!part_info)
6306-
#endif // WITH_PARTITION_STORAGE_ENGINE
63076305
{const char *src= options->srcdef;
63086306
PCSZ host, db, tab= options->tabname;
63096307
int port;
@@ -6567,7 +6565,6 @@ int ha_connect::create(const char *name, TABLE *table_arg,
65676565
} else
65686566
lwt[i]= tolower(options->type[i]);
65696567

6570-
#if defined(WITH_PARTITION_STORAGE_ENGINE)
65716568
if (part_info) {
65726569
char *p;
65736570

@@ -6577,17 +6574,14 @@ int ha_connect::create(const char *name, TABLE *table_arg,
65776574
strcat(strcat(strcpy(buf, p), "."), lwt);
65786575
*p= 0;
65796576
} else {
6580-
#endif // WITH_PARTITION_STORAGE_ENGINE
65816577
strcat(strcat(strcpy(buf, GetTableName()), "."), lwt);
65826578
sprintf(g->Message, "No file name. Table will use %s", buf);
65836579

65846580
if (sqlcom == SQLCOM_CREATE_TABLE)
65856581
push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
65866582

65876583
strcat(strcat(strcpy(dbpath, "./"), table->s->db.str), "/");
6588-
#if defined(WITH_PARTITION_STORAGE_ENGINE)
65896584
} // endif part_info
6590-
#endif // WITH_PARTITION_STORAGE_ENGINE
65916585

65926586
PlugSetPath(fn, buf, dbpath);
65936587

@@ -6652,11 +6646,9 @@ int ha_connect::create(const char *name, TABLE *table_arg,
66526646
push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0,
66536647
"Unexpected command in create, please contact CONNECT team");
66546648

6655-
#if defined(WITH_PARTITION_STORAGE_ENGINE)
66566649
if (part_info && !inward)
66576650
strncpy(partname, decode(g, strrchr(name, '#') + 1), sizeof(partname) - 1);
66586651
// strcpy(partname, part_info->curr_part_elem->partition_name);
6659-
#endif // WITH_PARTITION_STORAGE_ENGINE
66606652

66616653
if (g->Alchecked == 0 &&
66626654
(!IsFileType(type) || FileExists(options->filename, false))) {
@@ -6692,12 +6684,10 @@ int ha_connect::create(const char *name, TABLE *table_arg,
66926684
my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0));
66936685
rc = HA_ERR_INTERNAL_ERROR;
66946686
} else if (cat) {
6695-
#if defined(WITH_PARTITION_STORAGE_ENGINE)
66966687
if (part_info)
66976688
strncpy(partname,
66986689
decode(g, strrchr(name, (inward ? slash : '#')) + 1),
66996690
sizeof(partname) - 1);
6700-
#endif // WITH_PARTITION_STORAGE_ENGINE
67016691

67026692
if ((rc= optimize(table->in_use, NULL))) {
67036693
htrc("Create rc=%d %s\n", rc, g->Message);

storage/connect/json.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ typedef struct {
4444
int len;
4545
} STRG, *PSG;
4646

47+
char *NextChr(PSZ s, char sep);
48+
char *GetJsonNull(void);
49+
4750
PJSON ParseJson(PGLOBAL g, char *s, int n, int *prty = NULL, bool *b = NULL);
4851
PJAR ParseArray(PGLOBAL g, int& i, STRG& src, bool *pty);
4952
PJOB ParseObject(PGLOBAL g, int& i, STRG& src, bool *pty);

storage/connect/jsonudf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,7 +1620,7 @@ static my_bool CheckMemory(PGLOBAL g, UDF_INIT *initid, UDF_ARGS *args, uint n,
16201620
if (AllocSarea(g, ml)) {
16211621
char errmsg[MAX_STR];
16221622

1623-
sprintf(errmsg, MSG(WORK_AREA), g->Message);
1623+
snprintf(errmsg, sizeof(errmsg) - 1, MSG(WORK_AREA), g->Message);
16241624
strcpy(g->Message, errmsg);
16251625
return true;
16261626
} // endif SareaAlloc
@@ -1673,7 +1673,7 @@ static PCSZ MakeKey(PGLOBAL g, UDF_ARGS *args, int i)
16731673
n = strlen(s);
16741674

16751675
if (IsJson(args, i))
1676-
j = strchr(s, '_') - s + 1;
1676+
j = (int)(strchr(s, '_') - s + 1);
16771677

16781678
if (j && n > j) {
16791679
s += j;

storage/connect/mycat.cc

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/* ------------- */
1919
/* Version 1.6 */
2020
/* */
21-
/* Author: Olivier Bertrand 2012 - 2017 */
21+
/* Author: Olivier Bertrand 2012 - 2018 */
2222
/* */
2323
/* WHAT THIS PROGRAM DOES: */
2424
/* ----------------------- */
@@ -28,20 +28,13 @@
2828
/***********************************************************************/
2929
/* Include relevant MariaDB header file. */
3030
/***********************************************************************/
31-
#include <my_config.h>
31+
#define DONT_DEFINE_VOID
32+
#include <my_global.h>
3233

33-
#if defined(__WIN__)
34-
//#include <windows.h>
35-
//#include <sqlext.h>
36-
#elif defined(UNIX)
37-
#include <sys/types.h>
34+
#if defined(UNIX)
3835
#include <unistd.h>
39-
#include <stdlib.h>
40-
#include <stdio.h>
4136
#include <string.h>
4237
#endif
43-
#define DONT_DEFINE_VOID
44-
//#include <mysql/plugin.h>
4538
#include "handler.h"
4639
#undef OFFSET
4740

storage/connect/tabext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ bool TDBEXT::MakeSrcdef(PGLOBAL g)
286286
char *catp = strstr(Srcdef, "%s");
287287

288288
if (catp) {
289-
char *fil1, *fil2;
289+
char *fil1 = 0, *fil2;
290290
PCSZ ph = ((EXTDEF*)To_Def)->Phpos;
291291

292292
if (!ph)

storage/connect/tabjson.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
195195
tdp->Fn = GetStringTableOption(g, topt, "Filename", NULL);
196196

197197
if (!(tdp->Database = SetPath(g, db)))
198-
return NULL;
198+
return 0;
199199

200200
tdp->Objname = GetStringTableOption(g, topt, "Object", NULL);
201201
tdp->Base = GetIntegerTableOption(g, topt, "Base", 0) ? 1 : 0;
@@ -243,14 +243,14 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
243243
tjsp = new(g) TDBJSON(tdp, new(g) MAPFAM(tdp));
244244

245245
if (tjsp->MakeDocument(g))
246-
return NULL;
246+
return 0;
247247

248248
jsp = (tjsp->GetDoc()) ? tjsp->GetDoc()->GetValue(0) : NULL;
249249
} else {
250250
if (!(tdp->Lrecl = GetIntegerTableOption(g, topt, "Lrecl", 0)))
251251
if (!mgo) {
252252
sprintf(g->Message, "LRECL must be specified for pretty=%d", tdp->Pretty);
253-
return NULL;
253+
return 0;
254254
} else
255255
tdp->Lrecl = 8192; // Should be enough
256256

@@ -269,14 +269,14 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
269269
tjnp = new(g) TDBJSN(tdp, new(g) CMGFAM(tdp));
270270
#else
271271
sprintf(g->Message, "Mongo %s Driver not available", "C");
272-
return NULL;
272+
return 0;
273273
#endif
274274
} else if (tdp->Driver && toupper(*tdp->Driver) == 'J') {
275275
#if defined(JAVA_SUPPORT)
276276
tjnp = new(g) TDBJSN(tdp, new(g) JMGFAM(tdp));
277277
#else
278278
sprintf(g->Message, "Mongo %s Driver not available", "Java");
279-
return NULL;
279+
return 0;
280280
#endif
281281
} else { // Driver not specified
282282
#if defined(CMGO_SUPPORT)
@@ -285,7 +285,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
285285
tjnp = new(g) TDBJSN(tdp, new(g) JMGFAM(tdp));
286286
#else
287287
sprintf(g->Message, MSG(NO_FEAT_SUPPORT), "MONGO");
288-
return NULL;
288+
return 0;
289289
#endif
290290
} // endif Driver
291291

@@ -304,7 +304,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
304304
tjnp->SetG(G);
305305

306306
if (tjnp->OpenDB(g))
307-
return NULL;
307+
return 0;
308308

309309
switch (tjnp->ReadDB(g)) {
310310
case RC_EF:

storage/connect/tabjson.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ typedef class JSONDEF *PJDEF;
1616
typedef class TDBJSON *PJTDB;
1717
typedef class JSONCOL *PJCOL;
1818
class TDBJSN;
19+
PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info);
1920

2021
/***********************************************************************/
2122
/* The JSON tree node. Can be an Object or an Array. */

storage/connect/user_connect.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
#define DONT_DEFINE_VOID
3838
#define MYSQL_SERVER
39+
#include <my_global.h>
3940
#include "sql_class.h"
4041
#undef OFFSET
4142

0 commit comments

Comments
 (0)