mirror of
https://github.com/MariaDB/server.git
synced 2025-08-09 22:24:09 +03:00
Fix error and warnings raised by gcc on Linux:
Define O_RDONLY in jsonudf.cpp Correct wrong deinit function names Make Locate functions use the variable more Avoid signed/unsigned warning in ha_connect.cc GetIntegerTableOption Initialize oom in tabodbc MakeInsert modified: storage/connect/ha_connect.cc modified: storage/connect/jsonudf.cpp modified: storage/connect/tabodbc.cpp
This commit is contained in:
@@ -169,7 +169,7 @@
|
|||||||
#define JSONMAX 10 // JSON Default max grp size
|
#define JSONMAX 10 // JSON Default max grp size
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
char version[]= "Version 1.04.0003 October 20, 2015";
|
char version[]= "Version 1.04.0003 October 25, 2015";
|
||||||
#if defined(__WIN__)
|
#if defined(__WIN__)
|
||||||
char compver[]= "Version 1.04.0003 " __DATE__ " " __TIME__;
|
char compver[]= "Version 1.04.0003 " __DATE__ " " __TIME__;
|
||||||
char slash= '\\';
|
char slash= '\\';
|
||||||
@@ -1114,7 +1114,7 @@ int GetIntegerTableOption(PGLOBAL g, PTOS options, char *opname, int idef)
|
|||||||
else if (!stricmp(opname, "Compressed"))
|
else if (!stricmp(opname, "Compressed"))
|
||||||
opval= (options->compressed);
|
opval= (options->compressed);
|
||||||
|
|
||||||
if (opval == NO_IVAL) {
|
if (opval == (ulonglong)NO_IVAL) {
|
||||||
char *pv;
|
char *pv;
|
||||||
|
|
||||||
if ((pv= GetListOption(g, opname, options->oplist)))
|
if ((pv= GetListOption(g, opname, options->oplist)))
|
||||||
@@ -2222,7 +2222,8 @@ bool ha_connect::MakeKeyWhere(PGLOBAL g, PSTRG qry, OPVAL vop, char q,
|
|||||||
const key_range *kr)
|
const key_range *kr)
|
||||||
{
|
{
|
||||||
const uchar *ptr;
|
const uchar *ptr;
|
||||||
uint i, rem, len, klen, stlen;
|
//uint i, rem, len, klen, stlen;
|
||||||
|
uint i, rem, len, stlen;
|
||||||
bool nq, both, oom= false;
|
bool nq, both, oom= false;
|
||||||
OPVAL op;
|
OPVAL op;
|
||||||
Field *fp;
|
Field *fp;
|
||||||
@@ -2255,7 +2256,8 @@ bool ha_connect::MakeKeyWhere(PGLOBAL g, PSTRG qry, OPVAL vop, char q,
|
|||||||
else
|
else
|
||||||
oom|= qry->Append(" WHERE (");
|
oom|= qry->Append(" WHERE (");
|
||||||
|
|
||||||
klen= len= ranges[i]->length;
|
// klen= len= ranges[i]->length;
|
||||||
|
len= ranges[i]->length;
|
||||||
rem= kfp->user_defined_key_parts;
|
rem= kfp->user_defined_key_parts;
|
||||||
ptr= ranges[i]->key;
|
ptr= ranges[i]->key;
|
||||||
|
|
||||||
@@ -2541,6 +2543,8 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond)
|
|||||||
case MYSQL_TYPE_YEAR:
|
case MYSQL_TYPE_YEAR:
|
||||||
case MYSQL_TYPE_NEWDATE:
|
case MYSQL_TYPE_NEWDATE:
|
||||||
return NULL;
|
return NULL;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
} // endswitch type
|
} // endswitch type
|
||||||
|
|
||||||
if (trace) {
|
if (trace) {
|
||||||
|
@@ -15,10 +15,13 @@
|
|||||||
|
|
||||||
#include "jsonudf.h"
|
#include "jsonudf.h"
|
||||||
|
|
||||||
|
#if defined(UNIX) || defined(UNIV_LINUX)
|
||||||
|
#define _O_RDONLY O_RDONLY
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MEMFIX 4096
|
#define MEMFIX 4096
|
||||||
#if defined(connect_EXPORTS)
|
#if defined(connect_EXPORTS)
|
||||||
#define PUSH_WARNING(M) \
|
#define PUSH_WARNING(M) push_warning(current_thd, Sql_condition::WARN_LEVEL_WARN, 0, M)
|
||||||
push_warning(current_thd, Sql_condition::WARN_LEVEL_WARN, 0, M)
|
|
||||||
#else
|
#else
|
||||||
#define PUSH_WARNING(M) htrc(M)
|
#define PUSH_WARNING(M) htrc(M)
|
||||||
#endif
|
#endif
|
||||||
@@ -1356,7 +1359,11 @@ static char *GetJsonFile(PGLOBAL g, char *fn)
|
|||||||
char *str;
|
char *str;
|
||||||
int h, n, len;
|
int h, n, len;
|
||||||
|
|
||||||
|
#if defined(UNIX) || defined(UNIV_LINUX)
|
||||||
|
h= open(fn, O_RDONLY);
|
||||||
|
#else
|
||||||
h= open(fn, _O_RDONLY, _O_TEXT);
|
h= open(fn, _O_RDONLY, _O_TEXT);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (h == -1) {
|
if (h == -1) {
|
||||||
sprintf(g->Message, "Error %d opening %s", errno, fn);
|
sprintf(g->Message, "Error %d opening %s", errno, fn);
|
||||||
@@ -1504,7 +1511,7 @@ char *jsonvalue(UDF_INIT *initid, UDF_ARGS *args, char *result,
|
|||||||
return str;
|
return str;
|
||||||
} // end of JsonValue
|
} // end of JsonValue
|
||||||
|
|
||||||
void JsonValue_deinit(UDF_INIT* initid)
|
void jsonvalue_deinit(UDF_INIT* initid)
|
||||||
{
|
{
|
||||||
JsonFreeMem((PGLOBAL)initid->ptr);
|
JsonFreeMem((PGLOBAL)initid->ptr);
|
||||||
} // end of jsonvalue_deinit
|
} // end of jsonvalue_deinit
|
||||||
@@ -2804,12 +2811,12 @@ my_bool jsonlocate_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
|
|||||||
strcpy(message, "Fourth argument is not an integer (memory)");
|
strcpy(message, "Fourth argument is not an integer (memory)");
|
||||||
return true;
|
return true;
|
||||||
} else
|
} else
|
||||||
more = (ulong)*(longlong*)args->args[2];
|
more += (ulong)*(longlong*)args->args[2];
|
||||||
|
|
||||||
CalcLen(args, false, reslen, memlen);
|
CalcLen(args, false, reslen, memlen);
|
||||||
|
|
||||||
if (IsJson(args, 0) != 3)
|
if (IsJson(args, 0) != 3)
|
||||||
memlen += 1000; // TODO: calculate this
|
memlen += more; // TODO: calculate this
|
||||||
|
|
||||||
return JsonInit(initid, args, message, true, reslen, memlen);
|
return JsonInit(initid, args, message, true, reslen, memlen);
|
||||||
} // end of jsonlocate_init
|
} // end of jsonlocate_init
|
||||||
@@ -2905,7 +2912,7 @@ char *jsonlocate(UDF_INIT *initid, UDF_ARGS *args, char *result,
|
|||||||
return NULL;
|
return NULL;
|
||||||
} // end of jsonlocate
|
} // end of jsonlocate
|
||||||
|
|
||||||
void json_locate_deinit(UDF_INIT* initid)
|
void jsonlocate_deinit(UDF_INIT* initid)
|
||||||
{
|
{
|
||||||
JsonFreeMem((PGLOBAL)initid->ptr);
|
JsonFreeMem((PGLOBAL)initid->ptr);
|
||||||
} // end of jsonlocate_deinit
|
} // end of jsonlocate_deinit
|
||||||
@@ -2931,14 +2938,14 @@ my_bool json_locate_all_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
|
|||||||
strcpy(message, "Fourth argument is not an integer (memory)");
|
strcpy(message, "Fourth argument is not an integer (memory)");
|
||||||
return true;
|
return true;
|
||||||
} else
|
} else
|
||||||
more = (ulong)*(longlong*)args->args[2];
|
more += (ulong)*(longlong*)args->args[2];
|
||||||
|
|
||||||
CalcLen(args, false, reslen, memlen);
|
CalcLen(args, false, reslen, memlen);
|
||||||
|
|
||||||
if (IsJson(args, 0) != 3)
|
if (IsJson(args, 0) != 3)
|
||||||
memlen += 1000; // TODO: calculate this
|
memlen += more; // TODO: calculate this
|
||||||
|
|
||||||
return JsonInit(initid, args, message, true, reslen, memlen);
|
return JsonInit(initid, args, message, true, reslen, memlen);
|
||||||
} // end of json_locate_all_init
|
} // end of json_locate_all_init
|
||||||
|
|
||||||
char *json_locate_all(UDF_INIT *initid, UDF_ARGS *args, char *result,
|
char *json_locate_all(UDF_INIT *initid, UDF_ARGS *args, char *result,
|
||||||
@@ -3237,6 +3244,8 @@ char *jfile_make(UDF_INIT *initid, UDF_ARGS *args, char *result,
|
|||||||
case INT_RESULT:
|
case INT_RESULT:
|
||||||
pretty = (int)*(longlong*)args->args[i];
|
pretty = (int)*(longlong*)args->args[i];
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
PUSH_WARNING("Unexpected argument type in jfile_make");
|
||||||
} // endswitch arg_type
|
} // endswitch arg_type
|
||||||
|
|
||||||
if (fn) {
|
if (fn) {
|
||||||
@@ -3397,12 +3406,12 @@ char *jbin_array_add(UDF_INIT *initid, UDF_ARGS *args, char *result,
|
|||||||
if (!CheckMemory(g, initid, args, 2, false, true)) {
|
if (!CheckMemory(g, initid, args, 2, false, true)) {
|
||||||
int *x = NULL;
|
int *x = NULL;
|
||||||
uint n = 2;
|
uint n = 2;
|
||||||
PJSON jsp;
|
// PJSON jsp;
|
||||||
PJVAL jvp;
|
PJVAL jvp;
|
||||||
PJAR arp;
|
PJAR arp;
|
||||||
|
|
||||||
jvp = MakeValue(g, args, 0, &top);
|
jvp = MakeValue(g, args, 0, &top);
|
||||||
jsp = jvp->GetJson();
|
// jsp = jvp->GetJson();
|
||||||
x = GetIntArgPtr(g, args, n);
|
x = GetIntArgPtr(g, args, n);
|
||||||
|
|
||||||
if (CheckPath(g, args, top, jvp, n))
|
if (CheckPath(g, args, top, jvp, n))
|
||||||
|
@@ -513,7 +513,7 @@ bool TDBODBC::MakeInsert(PGLOBAL g)
|
|||||||
{
|
{
|
||||||
char *schmp = NULL, *catp = NULL, buf[NAM_LEN * 3];
|
char *schmp = NULL, *catp = NULL, buf[NAM_LEN * 3];
|
||||||
int len = 0;
|
int len = 0;
|
||||||
bool b = false, oom;
|
bool b = false, oom = false;
|
||||||
PTABLE tablep = To_Table;
|
PTABLE tablep = To_Table;
|
||||||
PCOL colp;
|
PCOL colp;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user