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

This is a major update of CONNECT that goes from version 1.1 to 1.2

===================================================================
- Implement a first support of the ALTER TABLE command. This fixes MDEV-5440
  but does much more than only that. See the details of how ALTER is supported
  in the new documentation and also in MDEV-5440 comment.
  This is done principally by implementing for CONNECT the virtual function
  check_if_supported_inplace_alter.
modified:
  storage/connect/connect.cc
  storage/connect/global.h
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/mysql-test/connect/r/bin.result
  storage/connect/mysql-test/connect/r/csv.result
  storage/connect/mysql-test/connect/r/dbf.result
  storage/connect/mysql-test/connect/r/dir.result
  storage/connect/mysql-test/connect/r/fix.result
  storage/connect/mysql-test/connect/r/index.result
  storage/connect/mysql-test/connect/r/ini.result
  storage/connect/mysql-test/connect/r/occur.result
  storage/connect/mysql-test/connect/r/pivot.result
  storage/connect/mysql-test/connect/r/vec.result
  storage/connect/mysql-test/connect/t/dbf.test
  storage/connect/plugutil.c
  storage/connect/user_connect.cc

- Fixes the tabname/table_name issue for XML tables. Implement
  multiple files XML tables.
modified:
  storage/connect/tabxml.cpp
  storage/connect/tabxml.h

- Set to varchar(256) the fields of catalog tables stored
  as STRBLK's (had length 0 --> CHAR(1))
  Add the GetCharString function to the VALBLK class
modified:
  storage/connect/ha_connect.cc
  storage/connect/valblk.cpp
  storage/connect/valblk.h
  storage/connect/value.cpp

- Translate CONNECT error messages to system_charset
  to avoid truncation on not ASCII characters.
modified:
  storage/connect/ha_connect.cc

- Update version number
modified:
  storage/connect/ha_connect.cc
  storage/connect/mysql-test/connect/r/xml.result

- Move the TDBASE::data_charset body from xtable.h to table.cpp.
  (dont' remember why)
modified:
  storage/connect/table.cpp
  storage/connect/xtable.h

- Other modifications are to enhance the support of OEM tables.
  In particular, they can now provide column definition in dicovery.
modified:
  storage/connect/colblk.h
  storage/connect/global.h
  storage/connect/ha_connect.cc
  storage/connect/mycat.cc
  storage/connect/plgcnx.h
  storage/connect/plgdbsem.h
  storage/connect/xtable.h

- Or to add or modify tracing.
modified:
  storage/connect/filamtxt.cpp
  storage/connect/ha_connect.cc
  storage/connect/plgdbutl.cpp
  storage/connect/tabfix.cpp
  storage/connect/tabmysql.cpp
This commit is contained in:
Olivier Bertrand
2014-02-03 16:14:13 +01:00
parent 4d5f5f4cdf
commit 5133cb5e25
33 changed files with 1027 additions and 354 deletions

View File

@@ -1,9 +1,9 @@
/************* Tabxml C++ Program Source Code File (.CPP) **************/
/* PROGRAM NAME: TABXML */
/* ------------- */
/* Version 2.6 */
/* Version 2.7 */
/* */
/* Author Olivier BERTRAND 2007 - 2013 */
/* Author Olivier BERTRAND 2007 - 2014 */
/* */
/* This program are the XML tables classes using MS-DOM or libxml2. */
/***********************************************************************/
@@ -47,6 +47,7 @@
#include "xindex.h"
#include "plgxml.h"
#include "tabxml.h"
#include "tabmul.h"
extern "C" {
extern char version[];
@@ -136,7 +137,8 @@ bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
} // endswitch typname
Tabname = Cat->GetStringCatInfo(g, "Name", Name); // Deprecated
Tabname = Cat->GetStringCatInfo(g, "Table_name", Tabname);
Tabname = Cat->GetStringCatInfo(g, "Table_name", Tabname); // Deprecated
Tabname = Cat->GetStringCatInfo(g, "Tabname", Tabname);
Rowname = Cat->GetStringCatInfo(g, "Rownode", defrow);
Colname = Cat->GetStringCatInfo(g, "Colnode", defcol);
Mulnode = Cat->GetStringCatInfo(g, "Mulnode", "");
@@ -177,7 +179,12 @@ bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
/***********************************************************************/
PTDB XMLDEF::GetTable(PGLOBAL g, MODE m)
{
return new(g) TDBXML(this);
PTDBASE tdbp = new(g) TDBXML(this);
if (Multiple)
tdbp = new(g) TDBMUL(tdbp);
return tdbp;
} // end of GetTable
/***********************************************************************/
@@ -245,6 +252,7 @@ TDBXML::TDBXML(PXMLDEF tdp) : TDBASE(tdp)
Void = false;
Usedom = tdp->Usedom;
Header = tdp->Header;
Multiple = tdp->Multiple;
Nrow = -1;
Irow = Header - 1;
Nsub = 0;
@@ -287,6 +295,7 @@ TDBXML::TDBXML(PTDBXML tdbp) : TDBASE(tdbp)
Void = tdbp->Void;
Usedom = tdbp->Usedom;
Header = tdbp->Header;
Multiple = tdbp->Multiple;
Nrow = tdbp->Nrow;
Irow = tdbp->Irow;
Nsub = tdbp->Nsub;
@@ -578,7 +587,7 @@ bool TDBXML::Initialize(PGLOBAL g)
#endif
} // end of try-catches
if (Root && Columns && !Nodedone) {
if (Root && Columns && (Multiple || !Nodedone)) {
// Allocate class nodes to avoid dynamic allocation
for (colp = (PXMLCOL)Columns; colp; colp = (PXMLCOL)colp->GetNext())
if (!colp->IsSpecial()) // Not a pseudo column
@@ -671,7 +680,10 @@ void TDBXML::SetNodeAttr(PGLOBAL g, char *attr, PXNODE node)
int TDBXML::Cardinality(PGLOBAL g)
{
if (!g)
return (Xpand || Coltype == 2) ? 0 : 1;
return (Multiple || Xpand || Coltype == 2) ? 0 : 1;
if (Multiple)
return 10;
if (Nrow < 0)
if (Initialize(g))
@@ -685,8 +697,13 @@ int TDBXML::Cardinality(PGLOBAL g)
/***********************************************************************/
int TDBXML::GetMaxSize(PGLOBAL g)
{
if (MaxSize < 0)
MaxSize = Cardinality(g) * ((Xpand) ? Limit : 1);
if (MaxSize < 0) {
if (!Multiple)
MaxSize = Cardinality(g) * ((Xpand) ? Limit : 1);
else
MaxSize = 10;
} // endif MaxSize
return MaxSize;
} // end of GetMaxSize
@@ -952,6 +969,34 @@ void TDBXML::CloseDB(PGLOBAL g)
Docp->CloseDoc(g, To_Xb);
} // endif docp
if (Multiple) {
// Reset all constants to start a new parse
Docp = NULL;
Root = NULL;
Curp = NULL;
DBnode = NULL;
TabNode = NULL;
RowNode = NULL;
ColNode = NULL;
Nlist = NULL;
Clist = NULL;
To_Xb = NULL;
Colp = NULL;
Changed = false;
Checked = false;
NextSame = false;
NewRow = false;
Hasnod = false;
Write = false;
// Bufdone = false;
Nodedone = false;
Void = false;
Nrow = -1;
Irow = Header - 1;
Nsub = 0;
N = 0;
} // endif Multiple
} // end of CloseDB
// ------------------------ XMLCOL functions ----------------------------