Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…-from-multiple-files-in-mariadb/60637429#60637429

  Import complex XML from multiple files in MariaDB
  Some row results are missing and replaced by the last file one.
  Thats because Nx and Sx column members are not reset when changing file.
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/tabxml.h
  • Loading branch information
Buggynours committed Mar 11, 2020
1 parent 85f2217 commit 41acc81
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions storage/connect/tabxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,12 +813,15 @@ bool TDBXML::Initialize(PGLOBAL g)
if (Void)
return false;

if (Columns && !Bufdone) {
if (Columns) {
// Allocate the buffers that will contain node values
for (colp = (PXMLCOL)Columns; colp; colp = (PXMLCOL)colp->GetNext())
if (!colp->IsSpecial()) // Not a pseudo column
if (colp->AllocBuf(g, Mode == MODE_INSERT))
return true;
if (!colp->IsSpecial()) { // Not a pseudo column
if (!Bufdone && colp->AllocBuf(g, Mode == MODE_INSERT))
return true;

colp->Nx = colp->Sx = -1;
} // endif Special

Bufdone = true;
} // endif Bufdone
Expand Down
1 change: 1 addition & 0 deletions storage/connect/tabxml.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class DllExport TDBXML : public TDBASE {
/* Class XMLCOL: XDB table access method column descriptor. */
/***********************************************************************/
class XMLCOL : public COLBLK {
friend class TDBXML;
public:
// Constructors
XMLCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "XML");
Expand Down

0 comments on commit 41acc81

Please sign in to comment.