Commit 70e567f5 authored by Olivier Bertrand's avatar Olivier Bertrand Committed by Sergei Golubchik

Squashed commit of connect/10.0:

commit 02d8c21380f
Author: Olivier Bertrand <bertrandop@gmail.com>
Date:   Sat Oct 6 16:27:13 2018 +0200

    - Fix truncating error messages on first unrecognized latin1 character
      modified:   storage/connect/ha_connect.cc

    - Fix MDEV-17343
      Reject multi-table UPDATE/DELETE commands that crash on some systems
      modified:   storage/connect/ha_connect.cc
      modified:   storage/connect/tabext.cpp

    - Try to fix failing tests (MariaDB version 10.0 only)
      modified:   storage/connect/mysql-test/connect/disabled.def

    - Typo
      modified:   storage/connect/global.h

commit f83caed8569
Author: Olivier Bertrand <bertrandop@gmail.com>
Date:   Tue Sep 25 15:49:26 2018 +0200

    - Try to fix failing tests (MariaDB version 10.0 only)
      modified:   storage/connect/mysql-test/connect/disabled.def
      modified:   storage/connect/mysql-test/connect/r/grant2.result
      modified:   storage/connect/mysql-test/connect/r/infoschema2-9739.result
      modified:   storage/connect/mysql-test/connect/r/mysql_exec.result

commit 9fd6f178846
Author: Olivier Bertrand <bertrandop@gmail.com>
Date:   Sun Sep 23 19:45:59 2018 +0200

    - Implement the CHECK TABLE statement and accept REPAIR and ANALYZE
      modified:   storage/connect/connect.cc
      modified:   storage/connect/ha_connect.cc
      modified:   storage/connect/ha_connect.h
      modified:   storage/connect/tabjdbc.cpp
      modified:   storage/connect/tabmysql.cpp
      modified:   storage/connect/tabodbc.cpp

    - MDEV-17212: Test if NumResultCols is implemented by the data source
      modified:   storage/connect/odbconn.cpp

    - Change error type in Optimize
      modified:   storage/connect/ha_connect.cc

    - Update version date
      modified:   storage/connect/ha_connect.cc

    - Record new result from odbc_postgresql.test
      modified:   storage/connect/mysql-test/connect/r/odbc_postgresql.result

commit d8cf51319e1
Author: Olivier Bertrand <bertrandop@gmail.com>
Date:   Wed Aug 8 12:18:52 2018 +0200

    - Comment out failing Cyrillic test in xml2.test
      modified:   storage/connect/mysql-test/connect/r/xml2.result
      modified:   storage/connect/mysql-test/connect/t/xml2.test

commit 9df49e21f9e
Author: Olivier Bertrand <bertrandop@gmail.com>
Date:   Tue Aug 7 15:01:06 2018 +0200

    - Fix MDEV-16672 Connect: Warnings with 10.0
      filamtxt.cpp: DOSFAM::RenameTempFile: Change sprintf to snprintf.
      filamvct.cpp: VECFAM::RenameTempFile: Change sprintf to snprintf.
      javaconn.cpp:
        Add JAVAConn::GetUTFString function.
        Use it instead of env->GetStringUTFChars.
        Fix wrong identation.
      javaconn.h: Add GetUTFString declaration.
      jdbconn.cpp:
        Use GetUTFString function instead of env->GetStringUTFChars.
      jmgoconn.cpp:
        Use GetUTFString function instead of env->GetStringUTFChars.
        Fix wrong identation.
      jsonudf.cpp: change 139 to BMX line 4631.
      tabjmg.cpp:
        Add ReleaseStringUTF.
        Fix wrong identation.
      tabpivot.cpp: Fix wrong identation.
      tabutil.cpp: TDBPRX::GetSubTable: Change sprintf to snprintf.
      modified:   storage/connect/filamtxt.cpp
      modified:   storage/connect/filamvct.cpp
      modified:   storage/connect/javaconn.cpp
      modified:   storage/connect/javaconn.h
      modified:   storage/connect/jdbconn.cpp
      modified:   storage/connect/jmgoconn.cpp
      modified:   storage/connect/jsonudf.cpp
      modified:   storage/connect/tabjmg.cpp
      modified:   storage/connect/tabpivot.cpp
      modified:   storage/connect/tabutil.cpp

    - Fix MDEV-16895 CONNECT engine's get_error_message can cause buffer
                     overflow and server crash with long queries
      ha_connect_cc: Update version.
        get_error_message: Remove charset conversion.
      modified:   storage/connect/ha_connect.cc

    - Fix a server crash on inserting bigint to a JDBC table
      JDBConn::SetUUID:
        Suppress check on ctyp that causes a server crash because ctyp
        can be negative and this triggers an DEBUG_ASSERT on return.
      modified:   storage/connect/jdbconn.cpp

    - Delete an assert(qrp) from JCATPARM *AllocCatInfo that is called with
      qrp=NULL from JDBConn::SetUUID. Also delete a clone of this function
      that was duplicated in javaconn.cpp.
      modified:   storage/connect/javaconn.cpp
      modified:   storage/connect/jdbconn.cpp

    - Update some disabled tests and results to avoid failure
      modified:   storage/connect/mysql-test/connect/r/jdbc.result
      modified:   storage/connect/mysql-test/connect/r/json_java_2.result
      modified:   storage/connect/mysql-test/connect/r/json_java_3.result
      modified:   storage/connect/mysql-test/connect/r/mongo_java_2.result
      modified:   storage/connect/mysql-test/connect/r/mongo_java_3.result
      modified:   storage/connect/mysql-test/connect/t/json_java_2.test
      modified:   storage/connect/mysql-test/connect/t/json_java_3.test
      modified:   storage/connect/mysql-test/connect/t/mongo_java_2.test
      modified:   storage/connect/mysql-test/connect/t/mongo_java_3.test

commit 415273eb193
Author: Olivier Bertrand <bertrandop@gmail.com>
Date:   Thu Jun 28 19:37:49 2018 +0200

    - Fix MDEV-16167 Cannot insert unsigned values into a VEC table
      modified:   storage/connect/filamvct.cpp
      modified:   storage/connect/tabvct.cpp

commit 9ffcb68a9f2
Author: Olivier Bertrand <bertrandop@gmail.com>
Date:   Mon May 7 22:43:43 2018 +0200

    - Fix MDEV-15735 CONNECT [filamtxt.cpp:429]: Suspicious condition
      modified:   storage/connect/filamtxt.cpp

    - Fix compiler warnings
      modified:   storage/connect/domdoc.cpp
      modified:   storage/connect/ha_connect.cc
      modified:   storage/connect/json.h
      modified:   storage/connect/jsonudf.cpp
      modified:   storage/connect/tabext.cpp
      modified:   storage/connect/tabjson.cpp
      modified:   storage/connect/tabjson.h

    - Miscelleanous from 10.3
      modified:   storage/connect/ha_connect.cc
      modified:   storage/connect/mycat.cc
      modified:   storage/connect/user_connect.cc
parent 411a2540
...@@ -254,7 +254,7 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2, ...@@ -254,7 +254,7 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2,
try { try {
if (!c1) { if (!c1) {
if (mode == MODE_INSERT) // if (mode == MODE_INSERT) or CHECK TABLE
// Allocate all column blocks for that table // Allocate all column blocks for that table
tdbp->ColDB(g, NULL, 0); tdbp->ColDB(g, NULL, 0);
......
...@@ -84,8 +84,8 @@ DOMDOC::DOMDOC(char *nsl, char *nsdf, char *enc, PFBLOCK fp) ...@@ -84,8 +84,8 @@ DOMDOC::DOMDOC(char *nsl, char *nsdf, char *enc, PFBLOCK fp)
: XMLDOCUMENT(nsl, nsdf, enc) : XMLDOCUMENT(nsl, nsdf, enc)
{ {
assert (!fp || fp->Type == TYPE_FB_XML); assert (!fp || fp->Type == TYPE_FB_XML);
Docp = (fp) ? ((PXBLOCK)fp)->Docp : NULL; Docp = (fp) ? ((PXBLOCK)fp)->Docp : (MSXML2::IXMLDOMDocumentPtr)NULL;
Nlist = NULL; Nlist = NULL;
Hr = 0; Hr = 0;
} // end of DOMDOC constructor } // end of DOMDOC constructor
......
...@@ -427,7 +427,7 @@ int TXTFAM::DeleteSortedRows(PGLOBAL g) ...@@ -427,7 +427,7 @@ int TXTFAM::DeleteSortedRows(PGLOBAL g)
for (i = 0; i < Posar->GetNval(); i++) { for (i = 0; i < Posar->GetNval(); i++) {
if ((irc = InitDelete(g, Posar->GetIntValue(ix[i]), if ((irc = InitDelete(g, Posar->GetIntValue(ix[i]),
Sosar->GetIntValue(ix[i])) == RC_FX)) Sosar->GetIntValue(ix[i]))) == RC_FX)
goto err; goto err;
// Now delete the sorted rows // Now delete the sorted rows
...@@ -1173,11 +1173,11 @@ int DOSFAM::RenameTempFile(PGLOBAL g) ...@@ -1173,11 +1173,11 @@ int DOSFAM::RenameTempFile(PGLOBAL g)
remove(filetemp); // May still be there from previous error remove(filetemp); // May still be there from previous error
if (rename(filename, filetemp)) { // Save file for security if (rename(filename, filetemp)) { // Save file for security
sprintf(g->Message, MSG(RENAME_ERROR), snprintf(g->Message, MAX_STR, MSG(RENAME_ERROR),
filename, filetemp, strerror(errno)); filename, filetemp, strerror(errno));
throw 51; throw 51;
} else if (rename(tempname, filename)) { } else if (rename(tempname, filename)) {
sprintf(g->Message, MSG(RENAME_ERROR), snprintf(g->Message, MAX_STR, MSG(RENAME_ERROR),
tempname, filename, strerror(errno)); tempname, filename, strerror(errno));
rc = rename(filetemp, filename); // Restore saved file rc = rename(filetemp, filename); // Restore saved file
throw 52; throw 52;
......
...@@ -348,7 +348,7 @@ int VCTFAM::Cardinality(PGLOBAL g) ...@@ -348,7 +348,7 @@ int VCTFAM::Cardinality(PGLOBAL g)
} // endif split } // endif split
return (Block) ? ((Block - 1) * Nrec + Last) : 0; return (Block) ? ((Block - 1) * Nrec + Last) : 0;
} // end of Cardinality } // end of Cardinality
/***********************************************************************/ /***********************************************************************/
...@@ -510,7 +510,8 @@ bool VCTFAM::AllocateBuffer(PGLOBAL g) ...@@ -510,7 +510,8 @@ bool VCTFAM::AllocateBuffer(PGLOBAL g)
for (; cp; cp = (PVCTCOL)cp->Next) for (; cp; cp = (PVCTCOL)cp->Next)
cp->Blk = AllocValBlock(g, NewBlock + Nrec * cp->Deplac, cp->Blk = AllocValBlock(g, NewBlock + Nrec * cp->Deplac,
cp->Buf_Type, Nrec, cp->Format.Length, cp->Buf_Type, Nrec, cp->Format.Length,
cp->Format.Prec, chk); cp->Format.Prec, chk, true,
cp->IsUnsigned());
return InitInsert(g); // Initialize inserting return InitInsert(g); // Initialize inserting
} else { } else {
...@@ -544,7 +545,8 @@ bool VCTFAM::AllocateBuffer(PGLOBAL g) ...@@ -544,7 +545,8 @@ bool VCTFAM::AllocateBuffer(PGLOBAL g)
for (; cp; cp = (PVCTCOL)cp->Next) for (; cp; cp = (PVCTCOL)cp->Next)
if (!cp->IsSpecial()) // Not a pseudo column if (!cp->IsSpecial()) // Not a pseudo column
cp->Blk = AllocValBlock(g, NULL, cp->Buf_Type, Nrec, cp->Blk = AllocValBlock(g, NULL, cp->Buf_Type, Nrec,
cp->Format.Length, cp->Format.Prec); cp->Format.Length, cp->Format.Prec,
true, true, cp->IsUnsigned());
} //endif mode } //endif mode
...@@ -1511,7 +1513,8 @@ bool VCMFAM::AllocateBuffer(PGLOBAL g) ...@@ -1511,7 +1513,8 @@ bool VCMFAM::AllocateBuffer(PGLOBAL g)
for (cp = (PVCTCOL)Tdbp->GetColumns(); cp; cp = (PVCTCOL)cp->Next) for (cp = (PVCTCOL)Tdbp->GetColumns(); cp; cp = (PVCTCOL)cp->Next)
if (!cp->IsSpecial()) { // Not a pseudo column if (!cp->IsSpecial()) { // Not a pseudo column
cp->Blk = AllocValBlock(g, (void*)1, cp->Buf_Type, Nrec, cp->Blk = AllocValBlock(g, (void*)1, cp->Buf_Type, Nrec,
cp->Format.Length, cp->Format.Prec); cp->Format.Length, cp->Format.Prec,
true, true, cp->IsUnsigned());
cp->AddStatus(BUF_MAPPED); cp->AddStatus(BUF_MAPPED);
} // endif IsSpecial } // endif IsSpecial
...@@ -2062,7 +2065,7 @@ bool VECFAM::AllocateBuffer(PGLOBAL g) ...@@ -2062,7 +2065,7 @@ bool VECFAM::AllocateBuffer(PGLOBAL g)
for (cp = (PVCTCOL)tdbp->Columns; cp; cp = (PVCTCOL)cp->Next) for (cp = (PVCTCOL)tdbp->Columns; cp; cp = (PVCTCOL)cp->Next)
cp->Blk = AllocValBlock(g, To_Bufs[cp->Index - 1], cp->Blk = AllocValBlock(g, To_Bufs[cp->Index - 1],
cp->Buf_Type, Nrec, cp->Format.Length, cp->Buf_Type, Nrec, cp->Format.Length,
cp->Format.Prec, chk); cp->Format.Prec, chk, true, cp->IsUnsigned());
return InitInsert(g); return InitInsert(g);
} else { } else {
...@@ -2111,7 +2114,8 @@ bool VECFAM::AllocateBuffer(PGLOBAL g) ...@@ -2111,7 +2114,8 @@ bool VECFAM::AllocateBuffer(PGLOBAL g)
for (cp = (PVCTCOL)tdbp->Columns; cp; cp = (PVCTCOL)cp->Next) for (cp = (PVCTCOL)tdbp->Columns; cp; cp = (PVCTCOL)cp->Next)
if (!cp->IsSpecial()) // Not a pseudo column if (!cp->IsSpecial()) // Not a pseudo column
cp->Blk = AllocValBlock(g, NULL, cp->Buf_Type, Nrec, cp->Blk = AllocValBlock(g, NULL, cp->Buf_Type, Nrec,
cp->Format.Length, cp->Format.Prec); cp->Format.Length, cp->Format.Prec,
true, true, cp->IsUnsigned());
} // endif mode } // endif mode
...@@ -2449,11 +2453,11 @@ int VECFAM::RenameTempFile(PGLOBAL g) ...@@ -2449,11 +2453,11 @@ int VECFAM::RenameTempFile(PGLOBAL g)
remove(filetemp); // May still be there from previous error remove(filetemp); // May still be there from previous error
if (rename(filename, filetemp)) { // Save file for security if (rename(filename, filetemp)) { // Save file for security
sprintf(g->Message, MSG(RENAME_ERROR), snprintf(g->Message, MAX_STR, MSG(RENAME_ERROR),
filename, filetemp, strerror(errno)); filename, filetemp, strerror(errno));
rc = RC_FX; rc = RC_FX;
} else if (rename(tempname, filename)) { } else if (rename(tempname, filename)) {
sprintf(g->Message, MSG(RENAME_ERROR), snprintf(g->Message, MAX_STR, MSG(RENAME_ERROR),
tempname, filename, strerror(errno)); tempname, filename, strerror(errno));
rc = rename(filetemp, filename); // Restore saved file rc = rename(filetemp, filename); // Restore saved file
rc = RC_FX; rc = RC_FX;
...@@ -2882,7 +2886,8 @@ bool VMPFAM::AllocateBuffer(PGLOBAL g) ...@@ -2882,7 +2886,8 @@ bool VMPFAM::AllocateBuffer(PGLOBAL g)
for (cp = (PVCTCOL)Tdbp->GetColumns(); cp; cp = (PVCTCOL)cp->Next) for (cp = (PVCTCOL)Tdbp->GetColumns(); cp; cp = (PVCTCOL)cp->Next)
if (!cp->IsSpecial()) { // Not a pseudo column if (!cp->IsSpecial()) { // Not a pseudo column
cp->Blk = AllocValBlock(g, (void*)1, cp->Buf_Type, Nrec, cp->Blk = AllocValBlock(g, (void*)1, cp->Buf_Type, Nrec,
cp->Format.Length, cp->Format.Prec); cp->Format.Length, cp->Format.Prec,
true, true, cp->IsUnsigned());
cp->AddStatus(BUF_MAPPED); cp->AddStatus(BUF_MAPPED);
} // endif IsSpecial } // endif IsSpecial
...@@ -3664,7 +3669,7 @@ bool BGVFAM::AllocateBuffer(PGLOBAL g) ...@@ -3664,7 +3669,7 @@ bool BGVFAM::AllocateBuffer(PGLOBAL g)
for (; cp; cp = (PVCTCOL)cp->Next) for (; cp; cp = (PVCTCOL)cp->Next)
cp->Blk = AllocValBlock(g, NewBlock + Nrec * cp->Deplac, cp->Blk = AllocValBlock(g, NewBlock + Nrec * cp->Deplac,
cp->Buf_Type, Nrec, cp->Format.Length, cp->Buf_Type, Nrec, cp->Format.Length,
cp->Format.Prec, chk); cp->Format.Prec, chk, true, cp->IsUnsigned());
InitInsert(g); // Initialize inserting InitInsert(g); // Initialize inserting
...@@ -3712,7 +3717,8 @@ bool BGVFAM::AllocateBuffer(PGLOBAL g) ...@@ -3712,7 +3717,8 @@ bool BGVFAM::AllocateBuffer(PGLOBAL g)
for (; cp; cp = (PVCTCOL)cp->Next) for (; cp; cp = (PVCTCOL)cp->Next)
if (!cp->IsSpecial()) // Not a pseudo column if (!cp->IsSpecial()) // Not a pseudo column
cp->Blk = AllocValBlock(g, NULL, cp->Buf_Type, Nrec, cp->Blk = AllocValBlock(g, NULL, cp->Buf_Type, Nrec,
cp->Format.Length, cp->Format.Prec); cp->Format.Length, cp->Format.Prec,
true, true, cp->IsUnsigned());
} //endif mode } //endif mode
......
/***********************************************************************/ /***********************************************************************/
/* GLOBAL.H: Declaration file used by all CONNECT implementations. */ /* GLOBAL.H: Declaration file used by all CONNECT implementations. */
/* (C) Copyright MariaDB Corporation Ab */ /* (C) Copyright MariaDB Corporation Ab */
/* Author Olivier Bertrand 1993-2017 */ /* Author Olivier Bertrand 1993-2018 */
/***********************************************************************/ /***********************************************************************/
/***********************************************************************/ /***********************************************************************/
...@@ -192,7 +192,7 @@ typedef struct _global { /* Global structure */ ...@@ -192,7 +192,7 @@ typedef struct _global { /* Global structure */
PACTIVITY Activityp; PACTIVITY Activityp;
char Message[MAX_STR]; char Message[MAX_STR];
ulong More; /* Used by jsonudf */ ulong More; /* Used by jsonudf */
int Createas; /* To pass info to created table */ int Createas; /* To pass multi to ext tables */
void *Xchk; /* indexes in create/alter */ void *Xchk; /* indexes in create/alter */
short Alchecked; /* Checked for ALTER */ short Alchecked; /* Checked for ALTER */
short Mrr; /* True when doing mrr */ short Mrr; /* True when doing mrr */
......
This diff is collapsed.
...@@ -347,11 +347,7 @@ PFIL CondFilter(PGLOBAL g, Item *cond); ...@@ -347,11 +347,7 @@ PFIL CondFilter(PGLOBAL g, Item *cond);
//PFIL CheckFilter(PGLOBAL g); //PFIL CheckFilter(PGLOBAL g);
/** admin commands - called from mysql_admin_table */ /** admin commands - called from mysql_admin_table */
virtual int check(THD* thd, HA_CHECK_OPT* check_opt) virtual int check(THD* thd, HA_CHECK_OPT* check_opt);
{
// TODO: implement it
return HA_ADMIN_OK; // Just to avoid error message with checktables
} // end of check
/** /**
Number of rows in table. It will only be called if Number of rows in table. It will only be called if
......
...@@ -81,29 +81,6 @@ GETDEF JAVAConn::GetDefaultJavaVMInitArgs = NULL; ...@@ -81,29 +81,6 @@ GETDEF JAVAConn::GetDefaultJavaVMInitArgs = NULL;
#define DEBUG_ONLY(f) ((void)0) #define DEBUG_ONLY(f) ((void)0)
#endif // !_DEBUG #endif // !_DEBUG
/***********************************************************************/
/* Allocate the structure used to refer to the result set. */
/***********************************************************************/
static JCATPARM *AllocCatInfo(PGLOBAL g, JCATINFO fid, PCSZ db,
PCSZ tab, PQRYRES qrp)
{
JCATPARM *cap;
#if defined(_DEBUG)
assert(qrp);
#endif
if ((cap = (JCATPARM *)PlgDBSubAlloc(g, NULL, sizeof(JCATPARM)))) {
memset(cap, 0, sizeof(JCATPARM));
cap->Id = fid;
cap->Qrp = qrp;
cap->DB = db;
cap->Tab = tab;
} // endif cap
return cap;
} // end of AllocCatInfo
/***********************************************************************/ /***********************************************************************/
/* JAVAConn construction/destruction. */ /* JAVAConn construction/destruction. */
/***********************************************************************/ /***********************************************************************/
...@@ -138,6 +115,16 @@ JAVAConn::JAVAConn(PGLOBAL g, PCSZ wrapper) ...@@ -138,6 +115,16 @@ JAVAConn::JAVAConn(PGLOBAL g, PCSZ wrapper)
// EndCom(); // EndCom();
// } // end of ~JAVAConn // } // end of ~JAVAConn
char *JAVAConn::GetUTFString(jstring s)
{
char *str;
const char *utf = env->GetStringUTFChars(s, nullptr);
str = PlugDup(m_G, utf);
env->ReleaseStringUTFChars(s, utf);
env->DeleteLocalRef(s);
return str;
} // end of GetUTFString
/***********************************************************************/ /***********************************************************************/
/* Screen for errors. */ /* Screen for errors. */
...@@ -152,17 +139,15 @@ bool JAVAConn::Check(jint rc) ...@@ -152,17 +139,15 @@ bool JAVAConn::Check(jint rc)
"toString", "()Ljava/lang/String;"); "toString", "()Ljava/lang/String;");
if (exc != nullptr && tid != nullptr) { if (exc != nullptr && tid != nullptr) {
jstring s = (jstring)env->CallObjectMethod(exc, tid); s = (jstring)env->CallObjectMethod(exc, tid);
const char *utf = env->GetStringUTFChars(s, NULL); Msg = GetUTFString(s);
env->DeleteLocalRef(s);
Msg = PlugDup(m_G, utf);
} else } else
Msg = "Exception occured"; Msg = "Exception occured";
env->ExceptionClear(); env->ExceptionClear();
} else if (rc < 0) { } else if (rc < 0) {
s = (jstring)env->CallObjectMethod(job, errid); s = (jstring)env->CallObjectMethod(job, errid);
Msg = (char*)env->GetStringUTFChars(s, NULL); Msg = GetUTFString(s);
} else } else
Msg = NULL; Msg = NULL;
......
...@@ -90,6 +90,7 @@ class DllExport JAVAConn : public BLOCK { ...@@ -90,6 +90,7 @@ class DllExport JAVAConn : public BLOCK {
// Java operations // Java operations
protected: protected:
char *GetUTFString(jstring s);
bool gmID(PGLOBAL g, jmethodID& mid, const char *name, const char *sig); bool gmID(PGLOBAL g, jmethodID& mid, const char *name, const char *sig);
bool Check(jint rc = 0); bool Check(jint rc = 0);
......
...@@ -314,10 +314,6 @@ static JCATPARM *AllocCatInfo(PGLOBAL g, JCATINFO fid, PCSZ db, ...@@ -314,10 +314,6 @@ static JCATPARM *AllocCatInfo(PGLOBAL g, JCATINFO fid, PCSZ db,
{ {
JCATPARM *cap; JCATPARM *cap;
#if defined(_DEBUG)
assert(qrp);
#endif
if ((cap = (JCATPARM *)PlgDBSubAlloc(g, NULL, sizeof(JCATPARM)))) { if ((cap = (JCATPARM *)PlgDBSubAlloc(g, NULL, sizeof(JCATPARM)))) {
memset(cap, 0, sizeof(JCATPARM)); memset(cap, 0, sizeof(JCATPARM));
cap->Id = fid; cap->Id = fid;
...@@ -699,21 +695,14 @@ bool JDBConn::SetUUID(PGLOBAL g, PTDBJDBC tjp) ...@@ -699,21 +695,14 @@ bool JDBConn::SetUUID(PGLOBAL g, PTDBJDBC tjp)
goto err; goto err;
} // endif rc } // endif rc
// Returns 666 is case of error // Should return 666 is case of error (not done yet)
//jtyp = env->CallIntMethod(job, typid, 5, nullptr); ctyp = (int)env->CallIntMethod(job, intfldid, 5, nullptr);
//if (Check((jtyp == 666) ? -1 : 1)) { //if (Check((ctyp == 666) ? -1 : 1)) {
// sprintf(g->Message, "Getting jtyp: %s", Msg); // sprintf(g->Message, "Getting ctyp: %s", Msg);
// goto err; // goto err;
//} // endif ctyp //} // endif ctyp
ctyp = (int)env->CallIntMethod(job, intfldid, 5, nullptr);
if (Check(ctyp)) {
sprintf(g->Message, "Getting ctyp: %s", Msg);
goto err;
} // endif ctyp
if (ctyp == 1111) if (ctyp == 1111)
((PJDBCCOL)colp)->uuid = true; ((PJDBCCOL)colp)->uuid = true;
...@@ -828,11 +817,11 @@ bool JDBConn::Connect(PJPARM sop) ...@@ -828,11 +817,11 @@ bool JDBConn::Connect(PJPARM sop)
jstring s = (jstring)env->CallObjectMethod(job, qcid); jstring s = (jstring)env->CallObjectMethod(job, qcid);
if (s != nullptr) { if (s != nullptr) {
char *qch = (char*)env->GetStringUTFChars(s, NULL); char *qch = GetUTFString(s);
m_IDQuoteChar[0] = *qch; m_IDQuoteChar[0] = *qch;
} else { } else {
s = (jstring)env->CallObjectMethod(job, errid); s = (jstring)env->CallObjectMethod(job, errid);
Msg = (char*)env->GetStringUTFChars(s, NULL); Msg = GetUTFString(s);
} // endif s } // endif s
} // endif qcid } // endif qcid
...@@ -1010,7 +999,7 @@ void JDBConn::SetColumnValue(int rank, PSZ name, PVAL val) ...@@ -1010,7 +999,7 @@ void JDBConn::SetColumnValue(int rank, PSZ name, PVAL val)
cn = nullptr; cn = nullptr;
if (cn) { if (cn) {
field = env->GetStringUTFChars(cn, NULL); field = GetUTFString(cn);
val->SetValue_psz((PSZ)field); val->SetValue_psz((PSZ)field);
} else } else
val->Reset(); val->Reset();
...@@ -1084,8 +1073,7 @@ void JDBConn::SetColumnValue(int rank, PSZ name, PVAL val) ...@@ -1084,8 +1073,7 @@ void JDBConn::SetColumnValue(int rank, PSZ name, PVAL val)
cn = nullptr; cn = nullptr;
if (cn) { if (cn) {
const char *field = env->GetStringUTFChars(cn, NULL); val->SetValue_psz((PSZ)GetUTFString(cn));
val->SetValue_psz((PSZ)field);
} else } else
val->Reset(); val->Reset();
...@@ -1364,19 +1352,19 @@ bool JDBConn::SetParam(JDBCCOL *colp) ...@@ -1364,19 +1352,19 @@ bool JDBConn::SetParam(JDBCCOL *colp)
for (i = 0, n = 0; i < size; i++) { for (i = 0, n = 0; i < size; i++) {
crp = qrp->Colresp; crp = qrp->Colresp;
js = (jstring)env->GetObjectArrayElement(s, n++); js = (jstring)env->GetObjectArrayElement(s, n++);
sval = (PSZ)env->GetStringUTFChars(js, 0); sval = GetUTFString(js);
crp->Kdata->SetValue(sval, i); crp->Kdata->SetValue(sval, i);
crp = crp->Next; crp = crp->Next;
js = (jstring)env->GetObjectArrayElement(s, n++); js = (jstring)env->GetObjectArrayElement(s, n++);
sval = (PSZ)env->GetStringUTFChars(js, 0); sval = GetUTFString(js);
crp->Kdata->SetValue(sval, i); crp->Kdata->SetValue(sval, i);
crp = crp->Next; crp = crp->Next;
js = (jstring)env->GetObjectArrayElement(s, n++); js = (jstring)env->GetObjectArrayElement(s, n++);
sval = (PSZ)env->GetStringUTFChars(js, 0); sval = GetUTFString(js);
crp->Kdata->SetValue(sval, i); crp->Kdata->SetValue(sval, i);
crp = crp->Next; crp = crp->Next;
js = (jstring)env->GetObjectArrayElement(s, n++); js = (jstring)env->GetObjectArrayElement(s, n++);
sval = (PSZ)env->GetStringUTFChars(js, 0); sval = GetUTFString(js);
crp->Kdata->SetValue(sval, i); crp->Kdata->SetValue(sval, i);
} // endfor i } // endfor i
...@@ -1462,7 +1450,7 @@ bool JDBConn::SetParam(JDBCCOL *colp) ...@@ -1462,7 +1450,7 @@ bool JDBConn::SetParam(JDBCCOL *colp)
return NULL; return NULL;
} // endif label } // endif label
name = env->GetStringUTFChars(label, NULL); name = GetUTFString(label);
crp = qrp->Colresp; // Column_Name crp = qrp->Colresp; // Column_Name
crp->Kdata->SetValue((char*)name, i); crp->Kdata->SetValue((char*)name, i);
n = env->GetIntArrayElements(val, 0); n = env->GetIntArrayElements(val, 0);
......
...@@ -522,7 +522,7 @@ PSZ JMgoConn::GetDocument(void) ...@@ -522,7 +522,7 @@ PSZ JMgoConn::GetDocument(void)
jdc = (jstring)env->CallObjectMethod(job, getdocid); jdc = (jstring)env->CallObjectMethod(job, getdocid);
if (jdc) if (jdc)
doc = (PSZ)env->GetStringUTFChars(jdc, NULL); doc = (PSZ)GetUTFString(jdc);
} // endif getdocid } // endif getdocid
...@@ -690,7 +690,7 @@ jobject JMgoConn::MakeDoc(PGLOBAL g, PJNCOL jcp) ...@@ -690,7 +690,7 @@ jobject JMgoConn::MakeDoc(PGLOBAL g, PJNCOL jcp)
} // endif Jncolp } // endif Jncolp
return parent; return parent;
} // end of MakeDoc } // end of MakeDoc
/***********************************************************************/ /***********************************************************************/
...@@ -807,7 +807,7 @@ PSZ JMgoConn::GetColumnValue(PSZ path) ...@@ -807,7 +807,7 @@ PSZ JMgoConn::GetColumnValue(PSZ path)
fn = (jstring)env->CallObjectMethod(job, objfldid, jn); fn = (jstring)env->CallObjectMethod(job, objfldid, jn);
if (fn) if (fn)
fld = (PSZ)env->GetStringUTFChars(fn, NULL); fld = (PSZ)GetUTFString(fn);
} // endif objfldid } // endif objfldid
......
...@@ -44,6 +44,9 @@ typedef struct { ...@@ -44,6 +44,9 @@ typedef struct {
int len; int len;
} STRG, *PSG; } STRG, *PSG;
char *NextChr(PSZ s, char sep);
char *GetJsonNull(void);
PJSON ParseJson(PGLOBAL g, char *s, int n, int *prty = NULL, bool *b = NULL); PJSON ParseJson(PGLOBAL g, char *s, int n, int *prty = NULL, bool *b = NULL);
PJAR ParseArray(PGLOBAL g, int& i, STRG& src, bool *pty); PJAR ParseArray(PGLOBAL g, int& i, STRG& src, bool *pty);
PJOB ParseObject(PGLOBAL g, int& i, STRG& src, bool *pty); PJOB ParseObject(PGLOBAL g, int& i, STRG& src, bool *pty);
......
...@@ -1620,7 +1620,7 @@ static my_bool CheckMemory(PGLOBAL g, UDF_INIT *initid, UDF_ARGS *args, uint n, ...@@ -1620,7 +1620,7 @@ static my_bool CheckMemory(PGLOBAL g, UDF_INIT *initid, UDF_ARGS *args, uint n,
if (AllocSarea(g, ml)) { if (AllocSarea(g, ml)) {
char errmsg[MAX_STR]; char errmsg[MAX_STR];
sprintf(errmsg, MSG(WORK_AREA), g->Message); snprintf(errmsg, sizeof(errmsg) - 1, MSG(WORK_AREA), g->Message);
strcpy(g->Message, errmsg); strcpy(g->Message, errmsg);
return true; return true;
} // endif SareaAlloc } // endif SareaAlloc
...@@ -1673,7 +1673,7 @@ static PCSZ MakeKey(PGLOBAL g, UDF_ARGS *args, int i) ...@@ -1673,7 +1673,7 @@ static PCSZ MakeKey(PGLOBAL g, UDF_ARGS *args, int i)
n = strlen(s); n = strlen(s);
if (IsJson(args, i)) if (IsJson(args, i))
j = strchr(s, '_') - s + 1; j = (int)(strchr(s, '_') - s + 1);
if (j && n > j) { if (j && n > j) {
s += j; s += j;
...@@ -4631,7 +4631,7 @@ char *jbin_array(UDF_INIT *initid, UDF_ARGS *args, char *result, ...@@ -4631,7 +4631,7 @@ char *jbin_array(UDF_INIT *initid, UDF_ARGS *args, char *result,
bsp = NULL; bsp = NULL;
if (!bsp && (bsp = JbinAlloc(g, args, initid->max_length, NULL))) if (!bsp && (bsp = JbinAlloc(g, args, initid->max_length, NULL)))
strncpy(bsp->Msg, g->Message, 139); strncpy(bsp->Msg, g->Message, BMX);
// Keep result of constant function // Keep result of constant function
g->Xchk = (initid->const_item) ? bsp : NULL; g->Xchk = (initid->const_item) ? bsp : NULL;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
/* ------------- */ /* ------------- */
/* Version 1.6 */ /* Version 1.6 */
/* */ /* */
/* Author: Olivier Bertrand 2012 - 2017 */ /* Author: Olivier Bertrand 2012 - 2018 */
/* */ /* */
/* WHAT THIS PROGRAM DOES: */ /* WHAT THIS PROGRAM DOES: */
/* ----------------------- */ /* ----------------------- */
...@@ -28,20 +28,13 @@ ...@@ -28,20 +28,13 @@
/***********************************************************************/ /***********************************************************************/
/* Include relevant MariaDB header file. */ /* Include relevant MariaDB header file. */
/***********************************************************************/ /***********************************************************************/
#include <my_config.h> #define DONT_DEFINE_VOID
#include <my_global.h>
#if defined(__WIN__) #if defined(UNIX)
//#include <windows.h>
//#include <sqlext.h>
#elif defined(UNIX)
#include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h> #include <string.h>
#endif #endif
#define DONT_DEFINE_VOID
//#include <mysql/plugin.h>
#include "handler.h" #include "handler.h"
#undef OFFSET #undef OFFSET
......
...@@ -9,14 +9,17 @@ ...@@ -9,14 +9,17 @@
# Do not use any TAB characters for whitespace. # Do not use any TAB characters for whitespace.
# #
############################################################################## ##############################################################################
jdbc : Variable settings depend on machine configuration infoschema-9739 : Crashes with MariaDB 10.0
jdbc_new : Variable settings depend on machine configuration infoschema2-9739 : Temporary until recording result with MariaDB 10.0
jdbc_oracle : Variable settings depend on machine configuration jdbc : Variable settings depend on machine configuration
jdbc_postgresql : Variable settings depend on machine configuration jdbc_new : Variable settings depend on machine configuration
json_mongo_c : Need MongoDB running and its C Driver installed jdbc_oracle : Variable settings depend on machine configuration
json_java_2 : Need MongoDB running and its Java Driver installed jdbc_postgresql : Variable settings depend on machine configuration
json_java_3 : Need MongoDB running and its Java Driver installed json_mongo_c : Need MongoDB running and its C Driver installed
mongo_c : Need MongoDB running and its C Driver installed json_java_2 : Need MongoDB running and its Java Driver installed
mongo_java_2 : Need MongoDB running and its Java Driver installed json_java_3 : Need MongoDB running and its Java Driver installed
mongo_java_3 : Need MongoDB running and its Java Driver installed mongo_c : Need MongoDB running and its C Driver installed
tbl_thread : Bug MDEV-9844,10179,14214 03/01/2018 OB Option THREAD removed mongo_java_2 : Need MongoDB running and its Java Driver installed
mongo_java_3 : Need MongoDB running and its Java Driver installed
tbl_thread : Bug MDEV-9844,10179,14214 03/01/2018 OB Option THREAD removed
vcol : Different error code on different versions
...@@ -622,7 +622,7 @@ test.t1 optimize status OK ...@@ -622,7 +622,7 @@ test.t1 optimize status OK
OPTIMIZE TABLE t1; OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 optimize Error Access denied for user 'user'@'localhost' (using password: NO) test.t1 optimize Error Access denied for user 'user'@'localhost' (using password: NO)
test.t1 optimize Error Got error 122 'This operation requires the FILE privilege' from CONNECT test.t1 optimize Error Can't lock file (errno: 122 "Internal (unspecified) error in handler")
test.t1 optimize error Corrupt test.t1 optimize error Corrupt
DROP TABLE t1; DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (adding columns) # Testing SQLCOM_ALTER_TABLE (adding columns)
......
...@@ -8,5 +8,5 @@ TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE ...@@ -8,5 +8,5 @@ TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE
Warnings: Warnings:
Warning 1286 Unknown storage engine 'InnoDB' Warning 1286 Unknown storage engine 'InnoDB'
Warning 1286 Unknown storage engine 'InnoDB' Warning 1286 Unknown storage engine 'InnoDB'
Warning 1296 Got error 174 'File t1.xml not found' from CONNECT Warning 1105
drop table t1; drop table t1;
...@@ -238,8 +238,7 @@ DROP TABLE t1, connect.emp; ...@@ -238,8 +238,7 @@ DROP TABLE t1, connect.emp;
CREATE TABLE t2 (command varchar(128) not null,number int(5) not null flag=1,message varchar(255) flag=2) ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:mariadb://localhost:PORT/connect' OPTION_LIST='User=root,Execsrc=1'; CREATE TABLE t2 (command varchar(128) not null,number int(5) not null flag=1,message varchar(255) flag=2) ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:mariadb://localhost:PORT/connect' OPTION_LIST='User=root,Execsrc=1';
SELECT * FROM t2 WHERE command='drop table tx1'; SELECT * FROM t2 WHERE command='drop table tx1';
command number message command number message
drop table tx1 0 Execute: java.sql.SQLSyntaxErrorException: Unknown table 'connect.tx1' drop table tx1 0 Execute: java.sql.SQLSyntaxErrorException: (conn:23) Unknown table 'connect.tx1'
Query is : drop table tx1
SELECT * FROM t2 WHERE command = 'create table tx1 (a int not null, b char(32), c double(8,2))'; SELECT * FROM t2 WHERE command = 'create table tx1 (a int not null, b char(32), c double(8,2))';
command number message command number message
create table tx1 (a int not null, b char(32), c double(8,2)) 0 Affected rows create table tx1 (a int not null, b char(32), c double(8,2)) 0 Affected rows
......
SET GLOBAL connect_class_path='C:/MariaDB-10.2/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo2.jar';
set connect_enable_mongo=1; set connect_enable_mongo=1;
# #
# Test the MONGO table type # Test the MONGO table type
......
SET GLOBAL connect_class_path='C:/MariaDB-10.2/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo3.jar';
set connect_enable_mongo=1; set connect_enable_mongo=1;
# #
# Test the MONGO table type # Test the MONGO table type
......
SET GLOBAL connect_class_path='C:/MariaDB-10.2/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo2.jar';
set connect_enable_mongo=1; set connect_enable_mongo=1;
# #
# Test the MONGO table type # Test the MONGO table type
......
SET GLOBAL connect_class_path='C:/MariaDB-10.2/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo3.jar';
set connect_enable_mongo=1; set connect_enable_mongo=1;
# #
# Test the MONGO table type # Test the MONGO table type
......
...@@ -30,6 +30,8 @@ insert ignore into t1(id) values(NULL) 1 1 Affected rows ...@@ -30,6 +30,8 @@ insert ignore into t1(id) values(NULL) 1 1 Affected rows
Warning 0 1364 Field 'msg' doesn't have a default value Warning 0 1364 Field 'msg' doesn't have a default value
update t1 set msg = 'Four' where id = 4 0 1 Affected rows update t1 set msg = 'Four' where id = 4 0 1 Affected rows
select * from t1 0 2 Result set columns select * from t1 0 2 Result set columns
Warnings:
Warning 1105 Result set columns
# #
# Checking Using Procedure # Checking Using Procedure
# #
...@@ -43,9 +45,13 @@ CALL p1('insert ignore into t1(id) values(NULL)'); ...@@ -43,9 +45,13 @@ CALL p1('insert ignore into t1(id) values(NULL)');
command warnings number message command warnings number message
insert ignore into t1(id) values(NULL) 1 1 Affected rows insert ignore into t1(id) values(NULL) 1 1 Affected rows
Warning 0 1364 Field 'msg' doesn't have a default value Warning 0 1364 Field 'msg' doesn't have a default value
Warnings:
Warning 1105 Affected rows
CALL p1('update t1 set msg = "Five" where id = 5'); CALL p1('update t1 set msg = "Five" where id = 5');
command warnings number message command warnings number message
update t1 set msg = "Five" where id = 5 0 1 Affected rows update t1 set msg = "Five" where id = 5 0 1 Affected rows
Warnings:
Warning 1105 Affected rows
DROP PROCEDURE p1; DROP PROCEDURE p1;
DROP TABLE t1; DROP TABLE t1;
SELECT * FROM t1; SELECT * FROM t1;
......
...@@ -99,9 +99,9 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu ...@@ -99,9 +99,9 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu
mtr public t1 a 4 int4 10 4 0 10 0 mtr public t1 a 4 int4 10 4 0 10 0
mtr public t2 a 4 int4 10 4 0 10 0 mtr public t2 a 4 int4 10 4 0 10 0
mtr public v1 a 4 int4 10 4 0 10 1 mtr public v1 a 4 int4 10 4 0 10 1
mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0 mtr schema1 t1 a 1 bpchar 10 40 NULL NULL 0
mtr schema1 t2 a 1 bpchar 10 60 NULL NULL 0 mtr schema1 t2 a 1 bpchar 10 40 NULL NULL 0
mtr schema1 v1 a 1 bpchar 10 60 NULL NULL 1 mtr schema1 v1 a 1 bpchar 10 40 NULL NULL 1
DROP TABLE t1; DROP TABLE t1;
# All columns in the schemas "public" and "schema1" # All columns in the schemas "public" and "schema1"
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.%.%'; CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.%.%';
...@@ -110,16 +110,16 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu ...@@ -110,16 +110,16 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu
mtr public t1 a 4 int4 10 4 0 10 0 mtr public t1 a 4 int4 10 4 0 10 0
mtr public t2 a 4 int4 10 4 0 10 0 mtr public t2 a 4 int4 10 4 0 10 0
mtr public v1 a 4 int4 10 4 0 10 1 mtr public v1 a 4 int4 10 4 0 10 1
mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0 mtr schema1 t1 a 1 bpchar 10 40 NULL NULL 0
mtr schema1 t2 a 1 bpchar 10 60 NULL NULL 0 mtr schema1 t2 a 1 bpchar 10 40 NULL NULL 0
mtr schema1 v1 a 1 bpchar 10 60 NULL NULL 1 mtr schema1 v1 a 1 bpchar 10 40 NULL NULL 1
DROP TABLE t1; DROP TABLE t1;
# All tables "t1" in all schemas # All tables "t1" in all schemas
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.%.t1'; CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.%.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
mtr public t1 a 4 int4 10 4 0 10 0 mtr public t1 a 4 int4 10 4 0 10 0
mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0 mtr schema1 t1 a 1 bpchar 10 40 NULL NULL 0
DROP TABLE t1; DROP TABLE t1;
# Table "t1" in the schema "public" # Table "t1" in the schema "public"
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.public.t1'; CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.public.t1';
...@@ -131,14 +131,14 @@ DROP TABLE t1; ...@@ -131,14 +131,14 @@ DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.schema1.t1'; CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.schema1.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0 mtr schema1 t1 a 1 bpchar 10 40 NULL NULL 0
DROP TABLE t1; DROP TABLE t1;
# All tables "t1" in all schemas (Catalog name is ignored by PostgreSQL) # All tables "t1" in all schemas (Catalog name is ignored by PostgreSQL)
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='xxx.%.t1'; CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='xxx.%.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
mtr public t1 a 4 int4 10 4 0 10 0 mtr public t1 a 4 int4 10 4 0 10 0
mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0 mtr schema1 t1 a 1 bpchar 10 40 NULL NULL 0
DROP TABLE t1; DROP TABLE t1;
# #
# Checking tables # Checking tables
......
...@@ -333,37 +333,6 @@ DROP TABLE t1; ...@@ -333,37 +333,6 @@ DROP TABLE t1;
# #
# Testing Cyrillic # Testing Cyrillic
# #
CREATE TABLE t1
(
c CHAR(16) CHARACTER SET utf8
) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='cp1251.xml'
OPTION_LIST='xmlsup=libxml2,rownode=b';
SELECT * FROM t1;
c БВГДЕЖЗ
INSERT INTO t1 VALUES ('ИКЛМН');
SELECT c, HEX(c) FROM t1;
c БВГДЕЖЗ
HEX(c) D091D092D093D094D095D096D097
c ИКЛМН
HEX(c) D098D09AD09BD09CD09D
DROP TABLE t1;
CREATE TABLE t1
(
c CHAR(16) CHARACTER SET cp1251
) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='cp1251.xml'
OPTION_LIST='xmlsup=libxml2,rownode=b';
SELECT * FROM t1;
c БВГДЕЖЗ
c ИКЛМН
INSERT INTO t1 VALUES ('ОПРСТ');
SELECT c, HEX(c) FROM t1;
c БВГДЕЖЗ
HEX(c) C1C2C3C4C5C6C7
c ИКЛМН
HEX(c) C8CACBCCCD
c ОПРСТ
HEX(c) CECFD0D1D2
DROP TABLE t1;
# #
# Testing that the underlying file is created with a proper Encoding # Testing that the underlying file is created with a proper Encoding
# #
......
-- source jdbconn.inc -- source jdbconn.inc
-- source mongo.inc -- source mongo.inc
--disable_query_log
eval SET GLOBAL connect_class_path='$MTR_SUITE_DIR/std_data/Mongo2.jar'; eval SET GLOBAL connect_class_path='$MTR_SUITE_DIR/std_data/Mongo2.jar';
--enable_query_log
let $DRV= Java; let $DRV= Java;
let $VERS= 2; let $VERS= 2;
let $TYPE= JSON; let $TYPE= JSON;
......
-- source jdbconn.inc -- source jdbconn.inc
-- source mongo.inc -- source mongo.inc
--disable_query_log
eval SET GLOBAL connect_class_path='$MTR_SUITE_DIR/std_data/Mongo3.jar'; eval SET GLOBAL connect_class_path='$MTR_SUITE_DIR/std_data/Mongo3.jar';
--enable_query_log
let $DRV= Java; let $DRV= Java;
let $VERS= 3; let $VERS= 3;
let $TYPE= JSON; let $TYPE= JSON;
......
-- source jdbconn.inc -- source jdbconn.inc
-- source mongo.inc -- source mongo.inc
--disable_query_log
eval SET GLOBAL connect_class_path='$MTR_SUITE_DIR/std_data/Mongo2.jar'; eval SET GLOBAL connect_class_path='$MTR_SUITE_DIR/std_data/Mongo2.jar';
--enable_query_log
let $DRV= Java; let $DRV= Java;
let $VERS= 2; let $VERS= 2;
let $TYPE= MONGO; let $TYPE= MONGO;
......
-- source jdbconn.inc -- source jdbconn.inc
-- source mongo.inc -- source mongo.inc
--disable_query_log
eval SET GLOBAL connect_class_path='$MTR_SUITE_DIR/std_data/Mongo3.jar'; eval SET GLOBAL connect_class_path='$MTR_SUITE_DIR/std_data/Mongo3.jar';
--enable_query_log
let $DRV= Java; let $DRV= Java;
let $VERS= 3; let $VERS= 3;
let $TYPE= MONGO; let $TYPE= MONGO;
......
...@@ -240,24 +240,24 @@ DROP TABLE t1; ...@@ -240,24 +240,24 @@ DROP TABLE t1;
--echo # --echo #
--echo # Testing Cyrillic --echo # Testing Cyrillic
--echo # --echo #
CREATE TABLE t1 #CREATE TABLE t1
( #(
c CHAR(16) CHARACTER SET utf8 # c CHAR(16) CHARACTER SET utf8
) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='cp1251.xml' #) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='cp1251.xml'
OPTION_LIST='xmlsup=libxml2,rownode=b'; # OPTION_LIST='xmlsup=libxml2,rownode=b';
SELECT * FROM t1; #SELECT * FROM t1;
INSERT INTO t1 VALUES ('ИКЛМН'); #INSERT INTO t1 VALUES ('ИКЛМН');
SELECT c, HEX(c) FROM t1; #SELECT c, HEX(c) FROM t1;
DROP TABLE t1; #DROP TABLE t1;
CREATE TABLE t1 #CREATE TABLE t1
( #(
c CHAR(16) CHARACTER SET cp1251 # c CHAR(16) CHARACTER SET cp1251
) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='cp1251.xml' #) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='cp1251.xml'
OPTION_LIST='xmlsup=libxml2,rownode=b'; # OPTION_LIST='xmlsup=libxml2,rownode=b';
SELECT * FROM t1; #SELECT * FROM t1;
INSERT INTO t1 VALUES ('ОПРСТ'); #INSERT INTO t1 VALUES ('ОПРСТ');
SELECT c, HEX(c) FROM t1; #SELECT c, HEX(c) FROM t1;
DROP TABLE t1; #DROP TABLE t1;
--echo # --echo #
......
...@@ -2354,11 +2354,11 @@ int ODBConn::GetCatInfo(CATPARM *cap) ...@@ -2354,11 +2354,11 @@ int ODBConn::GetCatInfo(CATPARM *cap)
if (!Check(rc)) if (!Check(rc))
ThrowDBX(rc, fnc, hstmt); ThrowDBX(rc, fnc, hstmt);
rc = SQLNumResultCols(hstmt, &ncol); // Some data source do not implement SQLNumResultCols
if (Check(SQLNumResultCols(hstmt, &ncol)))
// n because we no more ignore the first column // n because we no more ignore the first column
if ((n = (UWORD)qrp->Nbcol) > (UWORD)ncol) if ((n = (UWORD)qrp->Nbcol) > (UWORD)ncol)
ThrowDBX(MSG(COL_NUM_MISM)); ThrowDBX(MSG(COL_NUM_MISM));
// Unconditional to handle STRBLK's // Unconditional to handle STRBLK's
pval = (PVAL *)PlugSubAlloc(g, NULL, n * sizeof(PVAL)); pval = (PVAL *)PlugSubAlloc(g, NULL, n * sizeof(PVAL));
......
...@@ -125,6 +125,12 @@ EXTDEF::EXTDEF(void) ...@@ -125,6 +125,12 @@ EXTDEF::EXTDEF(void)
/***********************************************************************/ /***********************************************************************/
bool EXTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) bool EXTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
{ {
if (g->Createas) {
strcpy(g->Message,
"Multiple-table UPDATE/DELETE commands are not supported");
return true;
} // endif multi
Desc = NULL; Desc = NULL;
Tabname = GetStringCatInfo(g, "Name", Tabname = GetStringCatInfo(g, "Name",
(Catfunc & (FNC_TABLE | FNC_COL)) ? NULL : Name); (Catfunc & (FNC_TABLE | FNC_COL)) ? NULL : Name);
...@@ -286,7 +292,7 @@ bool TDBEXT::MakeSrcdef(PGLOBAL g) ...@@ -286,7 +292,7 @@ bool TDBEXT::MakeSrcdef(PGLOBAL g)
char *catp = strstr(Srcdef, "%s"); char *catp = strstr(Srcdef, "%s");
if (catp) { if (catp) {
char *fil1, *fil2; char *fil1 = 0, *fil2;
PCSZ ph = ((EXTDEF*)To_Def)->Phpos; PCSZ ph = ((EXTDEF*)To_Def)->Phpos;
if (!ph) if (!ph)
......
...@@ -1157,8 +1157,9 @@ bool TDBXJDC::OpenDB(PGLOBAL g) ...@@ -1157,8 +1157,9 @@ bool TDBXJDC::OpenDB(PGLOBAL g)
/* Get the command to execute. */ /* Get the command to execute. */
/*********************************************************************/ /*********************************************************************/
if (!(Cmdlist = MakeCMD(g))) { if (!(Cmdlist = MakeCMD(g))) {
Jcp->Close(); // Next lines commented out because of CHECK TABLE
return true; //Jcp->Close();
//return true;
} // endif Query } // endif Query
Rows = 1; Rows = 1;
...@@ -1189,8 +1190,10 @@ int TDBXJDC::ReadDB(PGLOBAL g) ...@@ -1189,8 +1190,10 @@ int TDBXJDC::ReadDB(PGLOBAL g)
Fpos++; // Used for progress info Fpos++; // Used for progress info
Cmdlist = (Nerr > Mxr) ? NULL : Cmdlist->Next; Cmdlist = (Nerr > Mxr) ? NULL : Cmdlist->Next;
return RC_OK; return RC_OK;
} else } else {
PushWarning(g, this, 1);
return RC_EF; return RC_EF;
} // endif Cmdlist
} // end of ReadDB } // end of ReadDB
......
...@@ -72,7 +72,7 @@ bool JMGDISC::Find(PGLOBAL g) ...@@ -72,7 +72,7 @@ bool JMGDISC::Find(PGLOBAL g)
bool JMGDISC::ColDesc(PGLOBAL g, jobject obj, char *pcn, char *pfmt, bool JMGDISC::ColDesc(PGLOBAL g, jobject obj, char *pcn, char *pfmt,
int ncol, int k) int ncol, int k)
{ {
const char *key; const char *key, *utf;
char colname[65]; char colname[65];
char fmt[129]; char fmt[129];
bool rc = true; bool rc = true;
...@@ -101,7 +101,10 @@ bool JMGDISC::ColDesc(PGLOBAL g, jobject obj, char *pcn, char *pfmt, ...@@ -101,7 +101,10 @@ bool JMGDISC::ColDesc(PGLOBAL g, jobject obj, char *pcn, char *pfmt,
continue; continue;
jkey = (jstring)Jcp->env->CallObjectMethod(Jcp->job, bvnameid); jkey = (jstring)Jcp->env->CallObjectMethod(Jcp->job, bvnameid);
key = Jcp->env->GetStringUTFChars(jkey, NULL); utf = Jcp->env->GetStringUTFChars(jkey, nullptr);
key = PlugDup(g, utf);
Jcp->env->ReleaseStringUTFChars(jkey, utf);
Jcp->env->DeleteLocalRef(jkey);
if (pcn) { if (pcn) {
strncpy(colname, pcn, 64); strncpy(colname, pcn, 64);
...@@ -457,8 +460,8 @@ PSZ JMGCOL::GetJpath(PGLOBAL g, bool proj) ...@@ -457,8 +460,8 @@ PSZ JMGCOL::GetJpath(PGLOBAL g, bool proj)
} else } else
*p2++ = *p1; *p2++ = *p1;
*p2 = 0; *p2 = 0;
return projpath; return projpath;
} else } else
return Jpath; return Jpath;
......
...@@ -16,6 +16,7 @@ typedef class JSONDEF *PJDEF; ...@@ -16,6 +16,7 @@ typedef class JSONDEF *PJDEF;
typedef class TDBJSON *PJTDB; typedef class TDBJSON *PJTDB;
typedef class JSONCOL *PJCOL; typedef class JSONCOL *PJCOL;
class TDBJSN; class TDBJSN;
PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info);
/***********************************************************************/ /***********************************************************************/
/* The JSON tree node. Can be an Object or an Array. */ /* The JSON tree node. Can be an Object or an Array. */
......
...@@ -1587,8 +1587,9 @@ bool TDBMYEXC::OpenDB(PGLOBAL g) ...@@ -1587,8 +1587,9 @@ bool TDBMYEXC::OpenDB(PGLOBAL g)
/* Get the command to execute. */ /* Get the command to execute. */
/*********************************************************************/ /*********************************************************************/
if (!(Cmdlist = MakeCMD(g))) { if (!(Cmdlist = MakeCMD(g))) {
Myc.Close(); // Next lines commented out because of CHECK TABLE
return true; //Myc.Close();
//return true;
} // endif Cmdlist } // endif Cmdlist
return false; return false;
...@@ -1647,8 +1648,10 @@ int TDBMYEXC::ReadDB(PGLOBAL g) ...@@ -1647,8 +1648,10 @@ int TDBMYEXC::ReadDB(PGLOBAL g)
++N; ++N;
return RC_OK; return RC_OK;
} else } else {
return RC_EF; PushWarning(g, this, 1);
return RC_EF;
} // endif Cmdlist
} // end of ReadDB } // end of ReadDB
......
...@@ -1249,9 +1249,10 @@ bool TDBXDBC::OpenDB(PGLOBAL g) ...@@ -1249,9 +1249,10 @@ bool TDBXDBC::OpenDB(PGLOBAL g)
/* Get the command to execute. */ /* Get the command to execute. */
/*********************************************************************/ /*********************************************************************/
if (!(Cmdlist = MakeCMD(g))) { if (!(Cmdlist = MakeCMD(g))) {
Ocp->Close(); // Next lines commented out because of CHECK TABLE
return true; //Ocp->Close();
} // endif Query //return true;
} // endif Cmdlist
Rows = 1; Rows = 1;
return false; return false;
...@@ -1274,8 +1275,10 @@ int TDBXDBC::ReadDB(PGLOBAL g) ...@@ -1274,8 +1275,10 @@ int TDBXDBC::ReadDB(PGLOBAL g)
Fpos++; // Used for progress info Fpos++; // Used for progress info
Cmdlist = (Nerr > Mxr) ? NULL : Cmdlist->Next; Cmdlist = (Nerr > Mxr) ? NULL : Cmdlist->Next;
return RC_OK; return RC_OK;
} else } else {
return RC_EF; PushWarning(g, this, 1);
return RC_EF;
} // endif Cmdlist
} // end of ReadDB } // end of ReadDB
......
...@@ -107,12 +107,12 @@ bool PIVAID::SkipColumn(PCOLRES crp, char *skc) ...@@ -107,12 +107,12 @@ bool PIVAID::SkipColumn(PCOLRES crp, char *skc)
/***********************************************************************/ /***********************************************************************/
PQRYRES PIVAID::MakePivotColumns(PGLOBAL g) PQRYRES PIVAID::MakePivotColumns(PGLOBAL g)
{ {
char *p, *query, *colname, *skc, buf[64]; char *p, *query, *colname, *skc, buf[64];
int ndif, nblin, w = 0; int ndif, nblin, w = 0;
bool b = false; bool b = false;
PVAL valp; PVAL valp;
PQRYRES qrp; PQRYRES qrp;
PCOLRES *pcrp, crp, fncrp = NULL; PCOLRES *pcrp, crp, fncrp = NULL;
try { try {
// Are there columns to skip? // Are there columns to skip?
...@@ -186,7 +186,7 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g) ...@@ -186,7 +186,7 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g)
} // endif picol } // endif picol
// Prepare the column list // Prepare the column list
for (pcrp = &Qryp->Colresp; crp = *pcrp; ) for (pcrp = &Qryp->Colresp; crp = *pcrp; )
if (SkipColumn(crp, skc)) { if (SkipColumn(crp, skc)) {
// Ignore this column // Ignore this column
...@@ -205,95 +205,95 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g) ...@@ -205,95 +205,95 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g)
} else } else
pcrp = &crp->Next; pcrp = &crp->Next;
if (!Rblkp) { if (!Rblkp) {
strcpy(g->Message, MSG(NO_DEF_PIVOTCOL)); strcpy(g->Message, MSG(NO_DEF_PIVOTCOL));
goto err; goto err;
} else if (!fncrp) { } else if (!fncrp) {
strcpy(g->Message, MSG(NO_DEF_FNCCOL)); strcpy(g->Message, MSG(NO_DEF_FNCCOL));
goto err; goto err;
} // endif } // endif
if (Tabsrc) { if (Tabsrc) {
Myc.Close(); Myc.Close();
b = false; b = false;
// Before calling sort, initialize all // Before calling sort, initialize all
nblin = Qryp->Nblin; nblin = Qryp->Nblin;
Index.Size = nblin * sizeof(int); Index.Size = nblin * sizeof(int);
Index.Sub = TRUE; // Should be small enough Index.Sub = TRUE; // Should be small enough
if (!PlgDBalloc(g, NULL, Index)) if (!PlgDBalloc(g, NULL, Index))
goto err; goto err;
Offset.Size = (nblin + 1) * sizeof(int); Offset.Size = (nblin + 1) * sizeof(int);
Offset.Sub = TRUE; // Should be small enough Offset.Sub = TRUE; // Should be small enough
if (!PlgDBalloc(g, NULL, Offset)) if (!PlgDBalloc(g, NULL, Offset))
goto err; goto err;
ndif = Qsort(g, nblin); ndif = Qsort(g, nblin);
if (ndif < 0) // error if (ndif < 0) // error
goto err; goto err;
} else { } else {
// The query was limited, we must get pivot column values // The query was limited, we must get pivot column values
// Returned values must be in their original character set // Returned values must be in their original character set
// if (Myc.ExecSQL(g, "SET character_set_results=NULL", &w) == RC_FX) // if (Myc.ExecSQL(g, "SET character_set_results=NULL", &w) == RC_FX)
// goto err; // goto err;
query = (char*)PlugSubAlloc(g, NULL, 0); query = (char*)PlugSubAlloc(g, NULL, 0);
sprintf(query, "SELECT DISTINCT `%s` FROM `%s`", Picol, Tabname); sprintf(query, "SELECT DISTINCT `%s` FROM `%s`", Picol, Tabname);
PlugSubAlloc(g, NULL, strlen(query) + 1); PlugSubAlloc(g, NULL, strlen(query) + 1);
Myc.FreeResult(); Myc.FreeResult();
// Send the source command to MySQL // Send the source command to MySQL
if (Myc.ExecSQL(g, query, &w) == RC_FX) if (Myc.ExecSQL(g, query, &w) == RC_FX)
goto err; goto err;
// We must have a storage query to get pivot column values // We must have a storage query to get pivot column values
if (!(qrp = Myc.GetResult(g, true))) if (!(qrp = Myc.GetResult(g, true)))
goto err; goto err;
Myc.Close(); Myc.Close();
b = false; b = false;
// Get the column list // Get the column list
crp = qrp->Colresp; crp = qrp->Colresp;
Rblkp = crp->Kdata; Rblkp = crp->Kdata;
ndif = qrp->Nblin; ndif = qrp->Nblin;
} // endif Tabsrc } // endif Tabsrc
// Allocate the Value used to retieve column names // Allocate the Value used to retieve column names
if (!(valp = AllocateValue(g, Rblkp->GetType(), if (!(valp = AllocateValue(g, Rblkp->GetType(),
Rblkp->GetVlen(), Rblkp->GetVlen(),
Rblkp->GetPrec()))) Rblkp->GetPrec())))
goto err; goto err;
// Now make the functional columns // Now make the functional columns
for (int i = 0; i < ndif; i++) { for (int i = 0; i < ndif; i++) {
if (i) { if (i) {
crp = (PCOLRES)PlugSubAlloc(g, NULL, sizeof(COLRES)); crp = (PCOLRES)PlugSubAlloc(g, NULL, sizeof(COLRES));
memcpy(crp, fncrp, sizeof(COLRES)); memcpy(crp, fncrp, sizeof(COLRES));
} else } else
crp = fncrp; crp = fncrp;
// Get the value that will be the generated column name // Get the value that will be the generated column name
if (Tabsrc) if (Tabsrc)
valp->SetValue_pvblk(Rblkp, Pex[Pof[i]]); valp->SetValue_pvblk(Rblkp, Pex[Pof[i]]);
else else
valp->SetValue_pvblk(Rblkp, i); valp->SetValue_pvblk(Rblkp, i);
colname = valp->GetCharString(buf); colname = valp->GetCharString(buf);
crp->Name = PlugDup(g, colname); crp->Name = PlugDup(g, colname);
crp->Flag = 1; crp->Flag = 1;
// Add this column // Add this column
*pcrp = crp; *pcrp = crp;
crp->Next = NULL; crp->Next = NULL;
pcrp = &crp->Next; pcrp = &crp->Next;
} // endfor i } // endfor i
// We added ndif columns and removed 2 (picol and fncol) // We added ndif columns and removed 2 (picol and fncol)
Qryp->Nbcol += (ndif - 2); Qryp->Nbcol += (ndif - 2);
...@@ -306,10 +306,10 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g) ...@@ -306,10 +306,10 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g)
} // end catch } // end catch
err: err:
if (b) if (b)
Myc.Close(); Myc.Close();
return NULL; return NULL;
} // end of MakePivotColumns } // end of MakePivotColumns
/***********************************************************************/ /***********************************************************************/
......
...@@ -429,7 +429,7 @@ PTDB TDBPRX::GetSubTable(PGLOBAL g, PTABLE tabp, bool b) ...@@ -429,7 +429,7 @@ PTDB TDBPRX::GetSubTable(PGLOBAL g, PTABLE tabp, bool b)
char buf[MAX_STR]; char buf[MAX_STR];
strcpy(buf, g->Message); strcpy(buf, g->Message);
sprintf(g->Message, "Error accessing %s.%s: %s", db, name, buf); snprintf(g->Message, MAX_STR, "Error accessing %s.%s: %s", db, name, buf);
hc->tshp = NULL; hc->tshp = NULL;
goto err; goto err;
} // endif Define } // endif Define
......
...@@ -456,13 +456,11 @@ bool VCTCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) ...@@ -456,13 +456,11 @@ bool VCTCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check)
if (tdbp->Txfp->GetAmType() == TYPE_AM_VMP && ok) { if (tdbp->Txfp->GetAmType() == TYPE_AM_VMP && ok) {
Blk = AllocValBlock(g, (void*)1, Buf_Type, tdbp->Txfp->Nrec, Blk = AllocValBlock(g, (void*)1, Buf_Type, tdbp->Txfp->Nrec,
Format.Length, Format.Length, Format.Prec, check, true, Unsigned);
Format.Prec, check);
Status |= BUF_MAPPED; // Will point into mapped file Status |= BUF_MAPPED; // Will point into mapped file
} else } else
Blk = AllocValBlock(g, NULL, Buf_Type, tdbp->Txfp->Nrec, Blk = AllocValBlock(g, NULL, Buf_Type, tdbp->Txfp->Nrec,
Format.Length, Format.Length, Format.Prec, check, true, Unsigned);
Format.Prec, check);
} // endif Mode } // endif Mode
return false; return false;
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#define DONT_DEFINE_VOID #define DONT_DEFINE_VOID
#define MYSQL_SERVER #define MYSQL_SERVER
#include <my_global.h>
#include "sql_class.h" #include "sql_class.h"
#undef OFFSET #undef OFFSET
......
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