From 28af4212b6e2afe1d42729c9c36215ed8a8d38cb Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Tue, 3 Nov 2020 18:40:28 +0100 Subject: - Implementation of the Json BJSON representation. VAL structures replace VALUE classes in binary trees. These parsed binary trees are swapped and saved on file Swapping is to replace pointers by offsets to make it portable. In restoring, class pointers to functions are realloced on place. Making BJSON files is done by the new UDF function jfile_bjson. modified: storage/connect/block.h modified: storage/connect/filamtxt.cpp modified: storage/connect/filamtxt.h modified: storage/connect/global.h modified: storage/connect/json.cpp modified: storage/connect/json.h modified: storage/connect/jsonudf.cpp modified: storage/connect/jsonudf.h modified: storage/connect/tabjson.cpp modified: storage/connect/tabjson.h modified: storage/connect/value.h - Make file (record) length and map memory possibly larger than MAX_INT modified: storage/connect/filamap.cpp modified: storage/connect/filamvct.cpp modified: storage/connect/maputil.cpp modified: storage/connect/maputil.h modified: storage/connect/tabdos.cpp modified: storage/connect/xindex.cpp - Make column length as bytes (not characters) This when making column definitions modified: storage/connect/ha_connect.cc - Change the message when making index fails modified: storage/connect/ha_connect.cc - Update tests and results to reflect recent changes modified: storage/connect/mysql-test/connect/r/alter_xml.result modified: storage/connect/mysql-test/connect/r/alter_xml2.result modified: storage/connect/mysql-test/connect/r/jdbc_oracle.result modified: storage/connect/mysql-test/connect/r/json.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/json_mongo_c.result modified: storage/connect/mysql-test/connect/r/mongo_c.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/r/odbc_oracle.result modified: storage/connect/mysql-test/connect/r/xml.result modified: storage/connect/mysql-test/connect/r/xml2.result modified: storage/connect/mysql-test/connect/r/xml2_html.result modified: storage/connect/mysql-test/connect/r/xml2_mult.result modified: storage/connect/mysql-test/connect/r/xml2_zip.result modified: storage/connect/mysql-test/connect/r/xml_html.result modified: storage/connect/mysql-test/connect/r/xml_mult.result modified: storage/connect/mysql-test/connect/r/xml_zip.result modified: storage/connect/mysql-test/connect/t/alter_xml.test modified: storage/connect/mysql-test/connect/t/alter_xml2.test modified: storage/connect/mysql-test/connect/t/jdbc_oracle.test modified: storage/connect/mysql-test/connect/t/json.test modified: storage/connect/mysql-test/connect/t/mongo_test.inc modified: storage/connect/mysql-test/connect/t/odbc_oracle.test modified: storage/connect/mysql-test/connect/t/xml.test modified: storage/connect/mysql-test/connect/t/xml2.test modified: storage/connect/mysql-test/connect/t/xml2_html.test modified: storage/connect/mysql-test/connect/t/xml2_mult.test modified: storage/connect/mysql-test/connect/t/xml2_zip.test modified: storage/connect/mysql-test/connect/t/xml_html.test modified: storage/connect/mysql-test/connect/t/xml_mult.test modified: storage/connect/mysql-test/connect/t/xml_zip.test - Typo modified: storage/connect/value.cpp --- storage/connect/ha_connect.cc | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'storage/connect/ha_connect.cc') diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index a3dfc50562d..859d50b9a2c 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -1574,6 +1574,7 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) // Now get column information pcf->Name= (char*)fp->field_name; + chset = (char*)fp->charset()->name; if (fop && fop->special) { pcf->Fieldfmt= (char*)fop->special; @@ -1584,8 +1585,15 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) pcf->Scale= 0; pcf->Opt= (fop) ? (int)fop->opt : 0; - if ((pcf->Length= fp->field_length) < 0) - pcf->Length= 256; // BLOB? + if (fp->field_length >= 0) { + pcf->Length = fp->field_length; + + // length is bytes for Connect, not characters + if (!strnicmp(chset, "utf8", 4)) + pcf->Length /= 3; + + } else + pcf->Length= 256; // BLOB? pcf->Precision= pcf->Length; @@ -1602,8 +1610,6 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) pcf->Fieldfmt= NULL; } // endif fop - chset= (char *)fp->charset()->name; - if (!strcmp(chset, "binary")) v = 'B'; // Binary string @@ -4940,11 +4946,11 @@ int ha_connect::external_lock(THD *thd, int lock_type) // Here we do make the new indexes if (tdp->MakeIndex(g, adp, true) == RC_FX) { // Make it a warning to avoid crash - push_warning(thd, Sql_condition::WARN_LEVEL_WARN, - 0, g->Message); - rc= 0; - //my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); - //rc= HA_ERR_INTERNAL_ERROR; + //push_warning(thd, Sql_condition::WARN_LEVEL_WARN, + // 0, g->Message); + //rc= 0; + my_message(ER_TOO_MANY_KEYS, g->Message, MYF(0)); + rc= HA_ERR_INDEX_CORRUPT; } // endif MakeIndex } else if (tdbp->GetDef()->Indexable() == 3) { -- cgit v1.2.1 From ecb00f3cd8cd55b402f504d4edc9e2ff08360809 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Thu, 5 Nov 2020 19:13:26 +0100 Subject: Try to fix failing tests --- storage/connect/ha_connect.cc | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'storage/connect/ha_connect.cc') diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 859d50b9a2c..d06ee5a6415 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -170,7 +170,7 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.07.0002 October 18, 2020"; + char version[]= "Version 1.07.0002 November 05, 2020"; #if defined(__WIN__) char compver[]= "Version 1.07.0002 " __DATE__ " " __TIME__; char slash= '\\'; @@ -398,7 +398,7 @@ static MYSQL_THDVAR_ENUM( // Adding JPATH to all Json table columns static MYSQL_THDVAR_BOOL(json_all_path, PLUGIN_VAR_RQCMDARG, "Adding JPATH to all Json table columns", - NULL, NULL, 0); // NO by default + NULL, NULL, 1); // YES by default // Null representation for JSON values static MYSQL_THDVAR_STR(json_null, @@ -411,7 +411,7 @@ static MYSQL_THDVAR_STR(json_null, static MYSQL_THDVAR_INT(default_depth, PLUGIN_VAR_RQCMDARG, "Default depth used by Json, XML and Mongo discovery", - NULL, NULL, 0, -1, 16, 1); + NULL, NULL, 5, -1, 16, 1); // Defaults to 5 // Estimate max number of rows for JSON aggregate functions static MYSQL_THDVAR_UINT(json_grp_size, @@ -4543,14 +4543,12 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn, bool quick) case TAB_DIR: case TAB_ZIP: case TAB_OEM: - if (table && table->pos_in_table_list) // if SELECT - { + if (table && table->pos_in_table_list) { // if SELECT #if MYSQL_VERSION_ID > 100200 Switch_to_definer_security_ctx backup_ctx(thd, table->pos_in_table_list); #endif // VERSION_ID > 100200 return check_global_access(thd, FILE_ACL); - } - else + } else return check_global_access(thd, FILE_ACL); case TAB_ODBC: case TAB_JDBC: @@ -5360,7 +5358,8 @@ static char *encode(PGLOBAL g, const char *cnm) */ static bool add_field(String* sql, TABTYPE ttp, const char* field_name, int typ, int len, int dec, char* key, uint tm, const char* rem, - char* dft, char* xtra, char* fmt, int flag, bool dbf, char v) { + char* dft, char* xtra, char* fmt, int flag, bool dbf, char v) +{ #if defined(DEVELOPMENT) // Some client programs regard CHAR(36) as GUID char var = (len > 255 || len == 36) ? 'V' : v; @@ -5604,8 +5603,8 @@ static int connect_assisted_discovery(handlerton *, THD* thd, String sql(buf, sizeof(buf), system_charset_info); sql.copy(STRING_WITH_LEN("CREATE TABLE whatever ("), system_charset_info); - user = host = pwd = tbl = src = col = ocl = pic = fcl = skc = rnk = zfn = NULL; - dsn = url = NULL; + user= host= pwd= tbl= src= col= ocl= pic= fcl= skc= rnk= zfn= NULL; + dsn= url= NULL; // Get the useful create options ttp= GetTypeID(topt->type); @@ -6268,7 +6267,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, // Now add the field if (add_field(&sql, ttp, cnm, typ, prec, dec, key, tm, rem, dft, xtra, - fmt, flg, dbf, v)) + fmt, flg, dbf, v)) rc= HA_ERR_OUT_OF_MEM; } // endfor i @@ -6767,8 +6766,8 @@ int ha_connect::create(const char *name, TABLE *table_arg, if (trace(1)) htrc("xchk=%p createas=%d\n", g->Xchk, g->Createas); -#if defined(ZIP_SUPPORT) if (options->zipped) { +#if defined(ZIP_SUPPORT) // Check whether the zip entry must be made from a file PCSZ fn= GetListOption(g, "Load", options->oplist, NULL); @@ -6790,9 +6789,11 @@ int ha_connect::create(const char *name, TABLE *table_arg, } // endif LoadFile } // endif fn - +#else // !ZIP_SUPPORT + my_message(ER_UNKNOWN_ERROR, "Option ZIP not supported", MYF(0)); + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); +#endif // !ZIP_SUPPORT } // endif zipped -#endif // ZIP_SUPPORT // To check whether indexes have to be made or remade if (!g->Xchk) { -- cgit v1.2.1 From 3ad6c0ef8a10aa3a2ba89126f54aac811a717285 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sat, 7 Nov 2020 16:33:01 +0100 Subject: Fix compile error. Modified ha_connect.cc --- storage/connect/ha_connect.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'storage/connect/ha_connect.cc') diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index d06ee5a6415..06029a3f670 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -251,6 +251,7 @@ bool ExactInfo(void); USETEMP UseTemp(void); int GetConvSize(void); TYPCONV GetTypeConv(void); +int GetDefaultDepth(void); bool JsonAllPath(void); char *GetJsonNull(void); uint GetJsonGrpSize(void); -- cgit v1.2.1 From 9193ceb2c4ed32757f567e3db865ab93f66b91a8 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Fri, 13 Nov 2020 19:42:56 +0100 Subject: Fix getting proper table type in discovery. modified storage/connect/ha_connect.cc --- storage/connect/ha_connect.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'storage/connect/ha_connect.cc') diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 06029a3f670..e9b9e5c24aa 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -170,7 +170,7 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.07.0002 November 05, 2020"; + char version[]= "Version 1.07.0002 November 13, 2020"; #if defined(__WIN__) char compver[]= "Version 1.07.0002 " __DATE__ " " __TIME__; char slash= '\\'; @@ -6093,6 +6093,10 @@ static int connect_assisted_discovery(handlerton *, THD* thd, goto err; } // endif !nblin + // Restore language type + if (ttp == TAB_REST) + ttp = GetTypeID(topt->type); + for (i= 0; !rc && i < qrp->Nblin; i++) { typ= len= prec= dec= flg= 0; tm= NOT_NULL_FLAG; -- cgit v1.2.1 From 4e8af8a6645136be34649abacb5b31ef64264584 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Tue, 1 Dec 2020 19:30:56 +0100 Subject: - Fix memory leak for the JSON table type (and continue BSON implementatio) modified: storage/connect/bson.cpp modified: storage/connect/bson.h modified: storage/connect/bsonudf.cpp modified: storage/connect/connect.cc modified: storage/connect/global.h modified: storage/connect/ha_connect.cc modified: storage/connect/jsonudf.cpp modified: storage/connect/mycat.cc modified: storage/connect/plgdbsem.h modified: storage/connect/plugutil.cpp modified: storage/connect/tabjson.cpp modified: storage/connect/tabjson.h modified: storage/connect/user_connect.cc - Desesperatly trying to fix xml.test failure modified: storage/connect/mysql-test/connect/r/xml.result --- storage/connect/ha_connect.cc | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'storage/connect/ha_connect.cc') diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index e9b9e5c24aa..4e7dd3ff394 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -170,7 +170,7 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.07.0002 November 13, 2020"; + char version[]= "Version 1.07.0002 November 30, 2020"; #if defined(__WIN__) char compver[]= "Version 1.07.0002 " __DATE__ " " __TIME__; char slash= '\\'; @@ -230,6 +230,9 @@ char *GetUserVariable(PGLOBAL g, const uchar *varname) PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info); PQRYRES VirColumns(PGLOBAL g, bool info); PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info); +#ifdef DEVELOPMENT +PQRYRES BSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info); +#endif // DEVEOPMENT PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info); #if defined(REST_SUPPORT) PQRYRES RESTColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info); @@ -4513,7 +4516,10 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn, bool quick) case TAB_VEC: case TAB_REST: case TAB_JSON: - if (options->filename && *options->filename) { +#if defined DEVELOPMENT + case TAB_BSON: +#endif // DEVELOPMENT + if (options->filename && *options->filename) { if (!quick) { char path[FN_REFLEN], dbpath[FN_REFLEN]; @@ -5679,7 +5685,10 @@ static int connect_assisted_discovery(handlerton *, THD* thd, } else if (topt->http) { switch (ttp) { case TAB_JSON: - case TAB_XML: +#ifdef DEVELOPMENT + case TAB_BSON: +#endif // DEVELOPMENT + case TAB_XML: case TAB_CSV: ttp = TAB_REST; break; @@ -5863,6 +5872,9 @@ static int connect_assisted_discovery(handlerton *, THD* thd, case TAB_XML: #endif // LIBXML2_SUPPORT || DOMDOC_SUPPORT case TAB_JSON: +#ifdef DEVELOPMENT + case TAB_BSON: +#endif // DEVELOPMENT dsn= strz(g, create_info->connect_string); if (!fn && !zfn && !mul && !dsn) @@ -6029,6 +6041,11 @@ static int connect_assisted_discovery(handlerton *, THD* thd, case TAB_JSON: qrp= JSONColumns(g, db, dsn, topt, fnc == FNC_COL); break; +#ifdef DEVELOPMENT + case TAB_BSON: + qrp= BSONColumns(g, db, dsn, topt, fnc == FNC_COL); + break; +#endif // DEVELOPMENT #if defined(JAVA_SUPPORT) case TAB_MONGO: url= strz(g, create_info->connect_string); -- cgit v1.2.1 From 7d439334fffcd9b44e524e3b8e3ef59009ebcac0 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Tue, 1 Dec 2020 20:57:05 +0100 Subject: Fix failed compile modified storage/connect/ha_connect.cc and mycat.cc --- storage/connect/ha_connect.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'storage/connect/ha_connect.cc') diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 4e7dd3ff394..fc67edc5330 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -170,7 +170,7 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.07.0002 November 30, 2020"; + char version[]= "Version 1.07.0002 December 01, 2020"; #if defined(__WIN__) char compver[]= "Version 1.07.0002 " __DATE__ " " __TIME__; char slash= '\\'; @@ -4516,7 +4516,7 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn, bool quick) case TAB_VEC: case TAB_REST: case TAB_JSON: -#if defined DEVELOPMENT +#if defined(DEVELOPMENT) case TAB_BSON: #endif // DEVELOPMENT if (options->filename && *options->filename) { @@ -5685,9 +5685,9 @@ static int connect_assisted_discovery(handlerton *, THD* thd, } else if (topt->http) { switch (ttp) { case TAB_JSON: -#ifdef DEVELOPMENT +#if defined(DEVELOPMENT) case TAB_BSON: -#endif // DEVELOPMENT +#endif // DEVELOPMENT case TAB_XML: case TAB_CSV: ttp = TAB_REST; @@ -5872,9 +5872,9 @@ static int connect_assisted_discovery(handlerton *, THD* thd, case TAB_XML: #endif // LIBXML2_SUPPORT || DOMDOC_SUPPORT case TAB_JSON: -#ifdef DEVELOPMENT +#if defined(DEVELOPMENT) case TAB_BSON: -#endif // DEVELOPMENT +#endif // DEVELOPMENT dsn= strz(g, create_info->connect_string); if (!fn && !zfn && !mul && !dsn) @@ -6041,11 +6041,11 @@ static int connect_assisted_discovery(handlerton *, THD* thd, case TAB_JSON: qrp= JSONColumns(g, db, dsn, topt, fnc == FNC_COL); break; -#ifdef DEVELOPMENT +#if defined(DEVELOPMENT) case TAB_BSON: qrp= BSONColumns(g, db, dsn, topt, fnc == FNC_COL); break; -#endif // DEVELOPMENT +#endif // DEVELOPMENT #if defined(JAVA_SUPPORT) case TAB_MONGO: url= strz(g, create_info->connect_string); -- cgit v1.2.1 From 4b6d661c7f4bcf9f0f5a9f5d5f4a6743983fc9a5 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Wed, 2 Dec 2020 00:35:58 +0100 Subject: Fix failed compile modified storage/connect/ha_connect.cc --- storage/connect/ha_connect.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'storage/connect/ha_connect.cc') diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index fc67edc5330..95f885c65b4 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -170,7 +170,7 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.07.0002 December 01, 2020"; + char version[]= "Version 1.07.0002 December 02, 2020"; #if defined(__WIN__) char compver[]= "Version 1.07.0002 " __DATE__ " " __TIME__; char slash= '\\'; @@ -4569,6 +4569,7 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn, bool quick) case TAB_OCCUR: case TAB_PIVOT: case TAB_VIR: + default: // This is temporary until a solution is found return false; } // endswitch type -- cgit v1.2.1 From 871532c3b9155fa00f7de61ef02f0c2d0f862d57 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Tue, 8 Dec 2020 01:15:40 +0100 Subject: - Continue BSON implementation modified: storage/connect/bson.cpp modified: storage/connect/bson.h modified: storage/connect/bsonudf.cpp modified: storage/connect/cmgfam.cpp modified: storage/connect/cmgfam.h modified: storage/connect/ha_connect.cc modified: storage/connect/jmgfam.cpp modified: storage/connect/jmgfam.h modified: storage/connect/jmgoconn.cpp modified: storage/connect/mycat.cc modified: storage/connect/tabbson.cpp modified: storage/connect/tabjson.cpp --- storage/connect/ha_connect.cc | 46 +++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 13 deletions(-) (limited to 'storage/connect/ha_connect.cc') diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 95f885c65b4..6728550447c 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -170,7 +170,7 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.07.0002 December 02, 2020"; + char version[]= "Version 1.07.0002 December 07, 2020"; #if defined(__WIN__) char compver[]= "Version 1.07.0002 " __DATE__ " " __TIME__; char slash= '\\'; @@ -230,9 +230,9 @@ char *GetUserVariable(PGLOBAL g, const uchar *varname) PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info); PQRYRES VirColumns(PGLOBAL g, bool info); PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info); -#ifdef DEVELOPMENT +#ifdef BSON_SUPPORT PQRYRES BSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info); -#endif // DEVEOPMENT +#endif // BSON_SUPPORT PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info); #if defined(REST_SUPPORT) PQRYRES RESTColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info); @@ -259,6 +259,9 @@ bool JsonAllPath(void); char *GetJsonNull(void); uint GetJsonGrpSize(void); char *GetJavaWrapper(void); +#if defined(BSON_SUPPORT) +bool Force_Bson(void); +#endif // BSON_SUPPORT size_t GetWorkSize(void); void SetWorkSize(size_t); extern "C" const char *msglang(void); @@ -444,6 +447,13 @@ static MYSQL_THDVAR_BOOL(enable_mongo, PLUGIN_VAR_RQCMDARG, #endif // !version 2,3 #endif // JAVA_SUPPORT || CMGO_SUPPORT +#if defined(BSON_SUPPORT) +// Force using BSON for JSON tables +static MYSQL_THDVAR_BOOL(force_bson, PLUGIN_VAR_RQCMDARG, + "Force using BSON for JSON tables", + NULL, NULL, 0); // NO by default +#endif // BSON_SUPPORT + #if defined(XMSG) || defined(NEWMSG) const char *language_names[]= { @@ -506,6 +516,8 @@ char *GetJavaWrapper(void) bool MongoEnabled(void) {return THDVAR(current_thd, enable_mongo);} #endif // JAVA_SUPPORT || CMGO_SUPPORT +bool Force_Bson(void) {return THDVAR(current_thd, force_bson);} + #if defined(XMSG) || defined(NEWMSG) extern "C" const char *msglang(void) {return language_names[THDVAR(current_thd, msg_lang)];} @@ -4516,9 +4528,9 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn, bool quick) case TAB_VEC: case TAB_REST: case TAB_JSON: -#if defined(DEVELOPMENT) +#if defined(BSON_SUPPORT) case TAB_BSON: -#endif // DEVELOPMENT +#endif // BSON_SUPPORT if (options->filename && *options->filename) { if (!quick) { char path[FN_REFLEN], dbpath[FN_REFLEN]; @@ -5444,7 +5456,10 @@ static bool add_field(String* sql, TABTYPE ttp, const char* field_name, int typ, if (fmt && *fmt) { switch (ttp) { case TAB_JSON: error |= sql->append(" JPATH='"); break; - case TAB_XML: error |= sql->append(" XPATH='"); break; +#if defined(BSON_SUPPORT) + case TAB_BSON: error |= sql->append(" JPATH='"); break; +#endif // BSON_SUPPORT + case TAB_XML: error |= sql->append(" XPATH='"); break; default: error |= sql->append(" FIELD_FORMAT='"); } // endswitch ttp @@ -5686,9 +5701,9 @@ static int connect_assisted_discovery(handlerton *, THD* thd, } else if (topt->http) { switch (ttp) { case TAB_JSON: -#if defined(DEVELOPMENT) +#if defined(BSON_SUPPORT) case TAB_BSON: -#endif // DEVELOPMENT +#endif // BSON_SUPPORT case TAB_XML: case TAB_CSV: ttp = TAB_REST; @@ -5873,9 +5888,9 @@ static int connect_assisted_discovery(handlerton *, THD* thd, case TAB_XML: #endif // LIBXML2_SUPPORT || DOMDOC_SUPPORT case TAB_JSON: -#if defined(DEVELOPMENT) +#if defined(BSON_SUPPORT) case TAB_BSON: -#endif // DEVELOPMENT +#endif // BSON_SUPPORT dsn= strz(g, create_info->connect_string); if (!fn && !zfn && !mul && !dsn) @@ -6040,13 +6055,15 @@ static int connect_assisted_discovery(handlerton *, THD* thd, qrp= VirColumns(g, fnc == FNC_COL); break; case TAB_JSON: +#if !defined(FORCE_BSON) qrp= JSONColumns(g, db, dsn, topt, fnc == FNC_COL); break; -#if defined(DEVELOPMENT) +#endif // !FORCE_BSON +#if defined(BSON_SUPPORT) case TAB_BSON: qrp= BSONColumns(g, db, dsn, topt, fnc == FNC_COL); break; -#endif // DEVELOPMENT +#endif // BSON_SUPPORT #if defined(JAVA_SUPPORT) case TAB_MONGO: url= strz(g, create_info->connect_string); @@ -7426,7 +7443,10 @@ static struct st_mysql_sys_var* connect_system_variables[]= { MYSQL_SYSVAR(enable_mongo), #endif // JAVA_SUPPORT || CMGO_SUPPORT MYSQL_SYSVAR(cond_push), - NULL +#if defined(BSON_SUPPORT) + MYSQL_SYSVAR(force_bson), +#endif // BSON_SUPPORT + NULL }; maria_declare_plugin(connect) -- cgit v1.2.1 From 4eeadedc77018da781eb7ea008fd3474f1a354d5 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Wed, 9 Dec 2020 00:55:06 +0100 Subject: - Fix json_bjson (s was erase by Json_Subset) modified: storage/connect/jsonudf.cpp modified: storage/connect/jsonudf.h - Fix compile error (Force_Bson was not conditional by BSON_SUPPORT) modified: storage/connect/ha_connect.cc - Continue Bjson implementation modified: storage/connect/block.h modified: storage/connect/bson.cpp modified: storage/connect/bson.h modified: storage/connect/bsonudf.cpp modified: storage/connect/bsonudf.h modified: storage/connect/plugutil.cpp modified: storage/connect/tabbson.cpp modified: storage/connect/tabjson.cpp - Typo deleted: storage/connect/Header.h --- storage/connect/ha_connect.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'storage/connect/ha_connect.cc') diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 6728550447c..65c3ea5c5d6 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -170,7 +170,7 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.07.0002 December 07, 2020"; + char version[]= "Version 1.07.0002 December 12, 2020"; #if defined(__WIN__) char compver[]= "Version 1.07.0002 " __DATE__ " " __TIME__; char slash= '\\'; @@ -516,7 +516,9 @@ char *GetJavaWrapper(void) bool MongoEnabled(void) {return THDVAR(current_thd, enable_mongo);} #endif // JAVA_SUPPORT || CMGO_SUPPORT +#if defined(BSON_SUPPORT) bool Force_Bson(void) {return THDVAR(current_thd, force_bson);} +#endif // BSON_SUPPORT) #if defined(XMSG) || defined(NEWMSG) extern "C" const char *msglang(void) -- cgit v1.2.1 From 24c18ce8926105d77ebff2d63611af440aaa8bee Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Fri, 18 Dec 2020 18:59:52 +0100 Subject: - Fix json parser (void objects not recognized) modified: json.cpp --- storage/connect/ha_connect.cc | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'storage/connect/ha_connect.cc') diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 65c3ea5c5d6..cf3a8866ff0 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -170,7 +170,7 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.07.0002 December 12, 2020"; + char version[]= "Version 1.07.0002 December 18, 2020"; #if defined(__WIN__) char compver[]= "Version 1.07.0002 " __DATE__ " " __TIME__; char slash= '\\'; @@ -1070,12 +1070,12 @@ static PGLOBAL GetPlug(THD *thd, PCONNECT& lxp) /****************************************************************************/ TABTYPE ha_connect::GetRealType(PTOS pos) { - TABTYPE type; + TABTYPE type= TAB_UNDEF; if (pos || (pos= GetTableOptionStruct())) { type= GetTypeID(pos->type); - if (type == TAB_UNDEF) + if (type == TAB_UNDEF && !pos->http) type= pos->srcdef ? TAB_MYSQL : pos->tabname ? TAB_PRX : TAB_DOS; #if defined(REST_SUPPORT) else if (pos->http) @@ -1083,7 +1083,8 @@ TABTYPE ha_connect::GetRealType(PTOS pos) case TAB_JSON: case TAB_XML: case TAB_CSV: - type = TAB_REST; + case TAB_UNDEF: + type = TAB_REST; break; case TAB_REST: type = TAB_NIY; @@ -1093,8 +1094,7 @@ TABTYPE ha_connect::GetRealType(PTOS pos) } // endswitch type #endif // REST_SUPPORT - } else - type= TAB_UNDEF; + } // endif pos return type; } // end of GetRealType @@ -5690,7 +5690,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, try { // Check table type - if (ttp == TAB_UNDEF) { + if (ttp == TAB_UNDEF && !topt->http) { topt->type= (src) ? "MYSQL" : (tab) ? "PROXY" : "DOS"; ttp= GetTypeID(topt->type); sprintf(g->Message, "No table_type. Was set to %s", topt->type); @@ -5708,7 +5708,8 @@ static int connect_assisted_discovery(handlerton *, THD* thd, #endif // BSON_SUPPORT case TAB_XML: case TAB_CSV: - ttp = TAB_REST; + case TAB_UNDEF: + ttp = TAB_REST; break; default: break; @@ -6131,8 +6132,10 @@ static int connect_assisted_discovery(handlerton *, THD* thd, } // endif !nblin // Restore language type - if (ttp == TAB_REST) - ttp = GetTypeID(topt->type); + if (ttp == TAB_REST) { + ttp = GetTypeID(topt->type); + ttp = (ttp == TAB_UNDEF) ? TAB_JSON : ttp; + } // endif ttp for (i= 0; !rc && i < qrp->Nblin; i++) { typ= len= prec= dec= flg= 0; -- cgit v1.2.1 From 2113cab7ec808721d3492870f094d681842e7274 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Tue, 22 Dec 2020 22:50:12 +0100 Subject: Make REST tables default file name. Commit before continuing BSON development --- storage/connect/ha_connect.cc | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'storage/connect/ha_connect.cc') diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index cf3a8866ff0..d6cbcbc077f 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -170,7 +170,7 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.07.0002 December 18, 2020"; + char version[]= "Version 1.07.0002 December 19, 2020"; #if defined(__WIN__) char compver[]= "Version 1.07.0002 " __DATE__ " " __TIME__; char slash= '\\'; @@ -5701,14 +5701,20 @@ static int connect_assisted_discovery(handlerton *, THD* thd, goto err; #if defined(REST_SUPPORT) } else if (topt->http) { - switch (ttp) { + if (ttp == TAB_UNDEF) { + topt->type = "JSON"; + ttp= GetTypeID(topt->type); + sprintf(g->Message, "No table_type. Was set to %s", topt->type); + push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message); + } // endif ttp + + switch (ttp) { case TAB_JSON: #if defined(BSON_SUPPORT) case TAB_BSON: #endif // BSON_SUPPORT case TAB_XML: case TAB_CSV: - case TAB_UNDEF: ttp = TAB_REST; break; default: @@ -5894,7 +5900,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, #if defined(BSON_SUPPORT) case TAB_BSON: #endif // BSON_SUPPORT - dsn= strz(g, create_info->connect_string); + dsn= strz(g, create_info->connect_string); if (!fn && !zfn && !mul && !dsn) sprintf(g->Message, "Missing %s file name", topt->type); @@ -6132,10 +6138,8 @@ static int connect_assisted_discovery(handlerton *, THD* thd, } // endif !nblin // Restore language type - if (ttp == TAB_REST) { + if (ttp == TAB_REST) ttp = GetTypeID(topt->type); - ttp = (ttp == TAB_UNDEF) ? TAB_JSON : ttp; - } // endif ttp for (i= 0; !rc && i < qrp->Nblin; i++) { typ= len= prec= dec= flg= 0; @@ -6436,6 +6440,9 @@ int ha_connect::create(const char *name, TABLE *table_arg, // Check table type if (type == TAB_UNDEF) { options->type= (options->srcdef) ? "MYSQL" : +#if defined(BSON_SUPPORT) + (options->http) ? "JSON" : +#endif // BSON_SUPPORT (options->tabname) ? "PROXY" : "DOS"; type= GetTypeID(options->type); sprintf(g->Message, "No table_type. Will be set to %s", options->type); -- cgit v1.2.1 From a35424829a4534ad63a80f30a73adb0ce74f742e Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sat, 26 Dec 2020 19:44:38 +0100 Subject: - Continue BSON implementation + fix create modified ha_connect.cc --- storage/connect/ha_connect.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'storage/connect/ha_connect.cc') diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index d6cbcbc077f..9b40b5c9a13 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -170,7 +170,7 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.07.0002 December 19, 2020"; + char version[]= "Version 1.07.0002 December 25, 2020"; #if defined(__WIN__) char compver[]= "Version 1.07.0002 " __DATE__ " " __TIME__; char slash= '\\'; @@ -6440,9 +6440,9 @@ int ha_connect::create(const char *name, TABLE *table_arg, // Check table type if (type == TAB_UNDEF) { options->type= (options->srcdef) ? "MYSQL" : -#if defined(BSON_SUPPORT) +#if defined(REST_SUPPORT) (options->http) ? "JSON" : -#endif // BSON_SUPPORT +#endif // REST_SUPPORT (options->tabname) ? "PROXY" : "DOS"; type= GetTypeID(options->type); sprintf(g->Message, "No table_type. Will be set to %s", options->type); @@ -6460,7 +6460,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, DBUG_RETURN(HA_ERR_INTERNAL_ERROR); inward= IsFileType(type) && !options->filename && - (type != TAB_JSON || !cnc.length); + ((type != TAB_JSON && type != TAB_BSON) || !cnc.length); if (options->data_charset) { const CHARSET_INFO *data_charset; -- cgit v1.2.1 From 21809f9a450df1bc44cef36377f96b516ac4a9ae Mon Sep 17 00:00:00 2001 From: Nikita Malyavin Date: Tue, 29 Dec 2020 13:38:16 +1000 Subject: MDEV-17556 Assertion `bitmap_is_set_all(&table->s->all_set)' failed The assertion failed in handler::ha_reset upon SELECT under READ UNCOMMITTED from table with index on virtual column. This was the debug-only failure, though the problem is mush wider: * MY_BITMAP is a structure containing my_bitmap_map, the latter is a raw bitmap. * read_set, write_set and vcol_set of TABLE are the pointers to MY_BITMAP * The rest of MY_BITMAPs are stored in TABLE and TABLE_SHARE * The pointers to the stored MY_BITMAPs, like orig_read_set etc, and sometimes all_set and tmp_set, are assigned to the pointers. * Sometimes tmp_use_all_columns is used to substitute the raw bitmap directly with all_set.bitmap * Sometimes even bitmaps are directly modified, like in TABLE::update_virtual_field(): bitmap_clear_all(&tmp_set) is called. The last three bullets in the list, when used together (which is mostly always) make the program flow cumbersome and impossible to follow, notwithstanding the errors they cause, like this MDEV-17556, where tmp_set pointer was assigned to read_set, write_set and vcol_set, then its bitmap was substituted with all_set.bitmap by dbug_tmp_use_all_columns() call, and then bitmap_clear_all(&tmp_set) was applied to all this. To untangle this knot, the rule should be applied: * Never substitute bitmaps! This patch is about this. orig_*, all_set bitmaps are never substituted already. This patch changes the following function prototypes: * tmp_use_all_columns, dbug_tmp_use_all_columns to accept MY_BITMAP** and to return MY_BITMAP * instead of my_bitmap_map* * tmp_restore_column_map, dbug_tmp_restore_column_maps to accept MY_BITMAP* instead of my_bitmap_map* These functions now will substitute read_set/write_set/vcol_set directly, and won't touch underlying bitmaps. --- storage/connect/ha_connect.cc | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'storage/connect/ha_connect.cc') diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 74951090787..f7117af030d 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -1387,7 +1387,7 @@ PCSZ ha_connect::GetStringOption(PCSZ opname, PCSZ sdef) PTOS options= GetTableOptionStruct(); if (!stricmp(opname, "Connect")) { - LEX_CSTRING cnc= (tshp) ? tshp->connect_string + LEX_CSTRING cnc= (tshp) ? tshp->connect_string : table->s->connect_string; if (cnc.length) @@ -2157,7 +2157,6 @@ int ha_connect::MakeRecord(char *buf) int rc= 0; Field* *field; Field *fp; - my_bitmap_map *org_bitmap; CHARSET_INFO *charset= tdbp->data_charset(); //MY_BITMAP readmap; MY_BITMAP *map; @@ -2172,7 +2171,7 @@ int ha_connect::MakeRecord(char *buf) *table->def_read_set.bitmap, *table->def_write_set.bitmap); // Avoid asserts in field::store() for columns that are not updated - org_bitmap= dbug_tmp_use_all_columns(table, table->write_set); + MY_BITMAP *org_bitmap= dbug_tmp_use_all_columns(table, &table->write_set); // This is for variable_length rows memset(buf, 0, table->s->null_bytes); @@ -2199,7 +2198,7 @@ int ha_connect::MakeRecord(char *buf) continue; htrc("Column %s not found\n", fp->field_name.str); - dbug_tmp_restore_column_map(table->write_set, org_bitmap); + dbug_tmp_restore_column_map(&table->write_set, org_bitmap); DBUG_RETURN(HA_ERR_WRONG_IN_RECORD); } // endif colp @@ -2259,7 +2258,7 @@ int ha_connect::MakeRecord(char *buf) sprintf(buf, "Out of range value %.140s for column '%s' at row %ld", value->GetCharString(val), - fp->field_name.str, + fp->field_name.str, thd->get_stmt_da()->current_row_for_warning()); push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, buf); @@ -2282,7 +2281,7 @@ int ha_connect::MakeRecord(char *buf) memcpy(buf, table->record[0], table->s->stored_rec_length); // This is copied from ha_tina and is necessary to avoid asserts - dbug_tmp_restore_column_map(table->write_set, org_bitmap); + dbug_tmp_restore_column_map(&table->write_set, org_bitmap); DBUG_RETURN(rc); } // end of MakeRecord @@ -2302,7 +2301,7 @@ int ha_connect::ScanRecord(PGLOBAL g, const uchar *) //PTDBASE tp= (PTDBASE)tdbp; String attribute(attr_buffer, sizeof(attr_buffer), table->s->table_charset); - my_bitmap_map *bmap= dbug_tmp_use_all_columns(table, table->read_set); + MY_BITMAP *bmap= dbug_tmp_use_all_columns(table, &table->read_set); const CHARSET_INFO *charset= tdbp->data_charset(); String data_charset_value(data_buffer, sizeof(data_buffer), charset); @@ -2424,7 +2423,7 @@ int ha_connect::ScanRecord(PGLOBAL g, const uchar *) } // endfor field err: - dbug_tmp_restore_column_map(table->read_set, bmap); + dbug_tmp_restore_column_map(&table->read_set, bmap); return rc; } // end of ScanRecord @@ -2472,7 +2471,7 @@ bool ha_connect::MakeKeyWhere(PGLOBAL g, PSTRG qry, OPVAL vop, char q, OPVAL op; Field *fp; const key_range *ranges[2]; - my_bitmap_map *old_map; + MY_BITMAP *old_map; KEY *kfp; KEY_PART_INFO *kpart; @@ -2489,7 +2488,7 @@ bool ha_connect::MakeKeyWhere(PGLOBAL g, PSTRG qry, OPVAL vop, char q, both= ranges[0] && ranges[1]; kfp= &table->key_info[active_index]; - old_map= dbug_tmp_use_all_columns(table, table->write_set); + old_map= dbug_tmp_use_all_columns(table, &table->write_set); for (i= 0; i <= 1; i++) { if (ranges[i] == NULL) @@ -2584,11 +2583,11 @@ bool ha_connect::MakeKeyWhere(PGLOBAL g, PSTRG qry, OPVAL vop, char q, if ((oom= qry->IsTruncated())) strcpy(g->Message, "Out of memory"); - dbug_tmp_restore_column_map(table->write_set, old_map); + dbug_tmp_restore_column_map(&table->write_set, old_map); return oom; err: - dbug_tmp_restore_column_map(table->write_set, old_map); + dbug_tmp_restore_column_map(&table->write_set, old_map); return true; } // end of MakeKeyWhere -- cgit v1.2.1 From 7edd4294be4e59c19539167620ff140e3f5e7f58 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Thu, 28 Jan 2021 01:02:29 +0100 Subject: - Continue BSON development modified: storage/connect/bson.cpp modified: storage/connect/bson.h modified: storage/connect/bsonudf.cpp modified: storage/connect/bsonudf.h modified: storage/connect/ha_connect.cc modified: storage/connect/jsonudf.cpp modified: storage/connect/mysql-test/connect/r/bson.result modified: storage/connect/mysql-test/connect/r/bson_udf.result modified: storage/connect/mysql-test/connect/t/bson_udf.inc modified: storage/connect/mysql-test/connect/t/bson_udf.test modified: storage/connect/mysql-test/connect/t/bson_udf2.inc modified: storage/connect/tabbson.cpp modified: storage/connect/tabbson.h --- storage/connect/ha_connect.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'storage/connect/ha_connect.cc') diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 9b40b5c9a13..69646e22e30 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -170,7 +170,7 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.07.0002 December 25, 2020"; + char version[]= "Version 1.07.0002 January 27, 2021"; #if defined(__WIN__) char compver[]= "Version 1.07.0002 " __DATE__ " " __TIME__; char slash= '\\'; @@ -255,6 +255,7 @@ USETEMP UseTemp(void); int GetConvSize(void); TYPCONV GetTypeConv(void); int GetDefaultDepth(void); +int GetDefaultPrec(void); bool JsonAllPath(void); char *GetJsonNull(void); uint GetJsonGrpSize(void); @@ -420,9 +421,15 @@ static MYSQL_THDVAR_INT(default_depth, "Default depth used by Json, XML and Mongo discovery", NULL, NULL, 5, -1, 16, 1); // Defaults to 5 +// Default precision for doubles +static MYSQL_THDVAR_INT(default_prec, + PLUGIN_VAR_RQCMDARG, + "Default precision used for doubles", + NULL, NULL, 6, 0, 16, 1); // Defaults to 6 + // Estimate max number of rows for JSON aggregate functions static MYSQL_THDVAR_UINT(json_grp_size, - PLUGIN_VAR_RQCMDARG, // opt + PLUGIN_VAR_RQCMDARG, // opt "max number of rows for JSON aggregate functions.", NULL, NULL, JSONMAX, 1, INT_MAX, 1); @@ -495,6 +502,7 @@ TYPCONV GetTypeConv(void) {return (TYPCONV)THDVAR(current_thd, type_conv);} char *GetJsonNull(void) {return connect_hton ? THDVAR(current_thd, json_null) : NULL;} int GetDefaultDepth(void) {return THDVAR(current_thd, default_depth);} +int GetDefaultPrec(void) {return THDVAR(current_thd, default_prec);} uint GetJsonGrpSize(void) {return connect_hton ? THDVAR(current_thd, json_grp_size) : 10;} size_t GetWorkSize(void) {return (size_t)THDVAR(current_thd, work_size);} @@ -4834,6 +4842,7 @@ int ha_connect::start_stmt(THD *thd, thr_lock_type lock_type) lock.cc by lock_external() and unlock_external() in lock.cc; the section "locking functions for mysql" in lock.cc; copy_data_between_tables() in sql_table.cc. + */ int ha_connect::external_lock(THD *thd, int lock_type) { @@ -7445,7 +7454,8 @@ static struct st_mysql_sys_var* connect_system_variables[]= { MYSQL_SYSVAR(json_null), MYSQL_SYSVAR(json_all_path), MYSQL_SYSVAR(default_depth), - MYSQL_SYSVAR(json_grp_size), + MYSQL_SYSVAR(default_prec), + MYSQL_SYSVAR(json_grp_size), #if defined(JAVA_SUPPORT) MYSQL_SYSVAR(jvm_path), MYSQL_SYSVAR(class_path), -- cgit v1.2.1