1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

- Fix Catalog JSON table crash when no Jpath

- Added JSON OBJECT specification for pretty != 2.
- Fix NULL values not recognized for nullable JSON columns
- Issue an error message when a JSON table is created without specifying LRECL if PRETTY != 2.
- Make JSONColumns use a TDBJSON class.
- Make JSON table using MAPFAM
modified:
  filamap.h
  filamtxt.h
  ha_connect.cc
  json.result
  tabjson.cpp
  tabjson.h
  table.cpp

- Implementing Discovery for the XML table type.
modified:
  domdoc.cpp
  domdoc.h
  ha_connect.cc
  libdoc.cpp
  plgxml.cpp
  plgxml.h
  reldef.cpp
  reldef.h
  tabxml.cpp
  tabxml.h

- Providing an error message when creating an ODBC table via discovery returns
  columns of more than one table.
modified:
  ha_connect.cc

- TableOptionStruct declaration moved from ha_connect.h to mycat.h
  To make it easier to use by other classes.
modified:
  ha_connect.cc
  ha_connect.h
  mycat.cc
  mycat.h
  reldef.cpp
  tabmysql.cpp
  taboccur.cpp
  tabpivot.cpp
  tabtbl.cpp
  tabutil.cpp
  tabxcl.cpp
This commit is contained in:
Olivier Bertrand
2015-04-17 20:05:41 +02:00
parent 05b30fbcc3
commit eae8318b19
25 changed files with 896 additions and 395 deletions

View File

@@ -162,10 +162,12 @@ class XML2ATTR : public XMLATTRIBUTE {
friend class XML2NODE;
public:
// Properties
//virtual char *GetText(void);
virtual char *GetName(PGLOBAL g) {return (char*)Atrp->name;}
virtual PXATTR GetNext(PGLOBAL g);
// Methods
virtual bool SetText(PGLOBAL g, char *txtp, int len);
virtual RCODE GetText(PGLOBAL g, char *bufp, int len);
virtual bool SetText(PGLOBAL g, char *txtp, int len);
protected:
// Constructor
@@ -812,7 +814,7 @@ PXNODE XML2NODE::GetNext(PGLOBAL g)
if (!Nodep->next)
Next = NULL;
else if (!Next)
else // if (!Next)
Next = new(g) XML2NODE(Doc, Nodep->next);
return Next;
@@ -828,7 +830,7 @@ PXNODE XML2NODE::GetChild(PGLOBAL g)
if (!Nodep->children)
Children = NULL;
else if (!Children)
else // if (!Children)
Children = new(g) XML2NODE(Doc, Nodep->children);
return Children;
@@ -978,10 +980,16 @@ PXNODE XML2NODE::SelectSingleNode(PGLOBAL g, char *xp, PXNODE np)
/******************************************************************/
PXATTR XML2NODE::GetAttribute(PGLOBAL g, char *name, PXATTR ap)
{
if (trace)
htrc("GetAttribute: %s\n", name);
xmlAttrPtr atp;
if (trace)
htrc("GetAttribute: %s\n", SVP(name));
if (name)
atp = xmlHasProp(Nodep, BAD_CAST name);
else
atp = Nodep->properties;
xmlAttrPtr atp = xmlHasProp(Nodep, BAD_CAST name);
if (atp) {
if (ap) {
@@ -1209,6 +1217,52 @@ XML2ATTR::XML2ATTR(PXDOC dp, xmlAttrPtr ap, xmlNodePtr np)
Parent = np;
} // end of XML2ATTR constructor
/******************************************************************/
/* Return the next sibling of the attribute. */
/******************************************************************/
PXATTR XML2ATTR::GetNext(PGLOBAL g)
{
if (trace)
htrc("Attr GetNext\n");
if (!Atrp->next)
return NULL;
else
return new(g) XML2ATTR(Doc, Atrp->next, Atrp->parent);
} // end of GetNext
/******************************************************************/
/* Return the text of an attribute. */
/******************************************************************/
RCODE XML2ATTR::GetText(PGLOBAL g, char *buf, int len)
{
RCODE rc = RC_OK;
xmlChar *txt;
if (trace)
htrc("GetText\n");
if ((txt = xmlGetProp(Atrp->parent, Atrp->name))) {
// Copy the text to the buffer
if (strlen((char*)txt) >= (unsigned)len) {
memcpy(buf, txt, len - 1);
buf[len - 1] = 0;
sprintf(g->Message, "Truncated %s content", Atrp->name);
rc = RC_INFO;
} else
strcpy(buf, (const char*)txt);
xmlFree(txt);
} else
*buf = '\0';
if (trace)
htrc("GetText: %s\n", buf);
return rc;
} // end of GetText
/******************************************************************/
/* Set the content of an attribute. */
/******************************************************************/