From 9ca150aa2c872d3254d7760480be9c832ea6cb59 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sat, 2 Feb 2013 00:18:32 +0100 Subject: [PATCH] =?UTF-8?q?2>libdoc.cpp=202>D:\CommonSource\mariadb-10.0\i?= =?UTF-8?q?nclude\my=5Fpthread.h(120)=20:=20warning=20C4005:=20'=5FREENTRA?= =?UTF-8?q?NT'=C2=A0:=20red=C3=A9finition=20de=20macro=202>=20=20=20=20=20?= =?UTF-8?q?=20=20=20D:\Libxml\include\libxml/xmlexports.h(77)=C2=A0:=20voi?= =?UTF-8?q?r=20la=20d=C3=A9finition=20pr=C3=A9c=C3=A9dente=20de=20'=5FREEN?= =?UTF-8?q?TRANT'=202>.\libdoc.cpp(378)=20:=20error=20C2664:=20'strlen'?= =?UTF-8?q?=C2=A0:=20impossible=20de=20convertir=20le=20param=C3=A8tre=201?= =?UTF-8?q?=20de=20'xmlChar=20*'=20en=20'const=20char=20*'=202>=20=20=20?= =?UTF-8?q?=20=20=20=20=20Les=20types=20point=C3=A9s=20n'ont=20aucun=20rap?= =?UTF-8?q?port=20entre=20eux=C2=A0;=20conversion=20n=C3=A9cessitant=20rei?= =?UTF-8?q?nterpret=5Fcast,=20cast=20de=20style=20C=20ou=20cast=20de=20sty?= =?UTF-8?q?le=20fonction=202>.\libdoc.cpp(379)=20:=20error=20C2664:=20'cop?= =?UTF-8?q?y=5Fand=5Fconvert'=C2=A0:=20impossible=20de=20convertir=20le=20?= =?UTF-8?q?param=C3=A8tre=204=20de=20'xmlChar=20*'=20en=20'const=20char=20?= =?UTF-8?q?*'=202>=20=20=20=20=20=20=20=20Les=20types=20point=C3=A9s=20n'o?= =?UTF-8?q?nt=20aucun=20rapport=20entre=20eux=C2=A0;=20conversion=20n?= =?UTF-8?q?=C3=A9cessitant=20reinterpret=5Fcast,=20cast=20de=20style=20C?= =?UTF-8?q?=20ou=20cast=20de=20style=20fonction=202>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix for that. --- storage/connect/ha_connect.cc | 2 +- storage/connect/libdoc.cpp | 13 +++++++------ storage/connect/tabxml.cpp | 27 +++++++++++++++------------ 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index a167b47c475..7c2b861f03e 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -1317,7 +1317,7 @@ bool ha_connect::OpenTable(PGLOBAL g, bool del) istable= true; // strmake(tname, table_name, sizeof(tname)-1); - if (xmod == MODE_ANY && *tdbp->GetName() != '#') { + if (xmod == MODE_ANY && stop && *tdbp->GetName() != '#') { // We are in a create index query if (!((PTDBASE)tdbp)->GetDef()->Indexable()) { sprintf(g->Message, "Table %s cannot be indexed", tdbp->GetName()); diff --git a/storage/connect/libdoc.cpp b/storage/connect/libdoc.cpp index e01bc39604b..cef4fa7b01e 100644 --- a/storage/connect/libdoc.cpp +++ b/storage/connect/libdoc.cpp @@ -373,10 +373,11 @@ bool LIBXMLDOC::CheckDocument(FILE *of, xmlNodePtr np) /******************************************************************/ int LIBXMLDOC::Decode(xmlChar *cnt, char *buf, int n) { - uint dummy_errors; - uint32 len= copy_and_convert(buf, n, &my_charset_latin1, - cnt, strlen(cnt), &my_charset_utf8_bin, - &dummy_errors); + const char *txt = (const char *)cnt; + uint dummy_errors; + uint32 len= copy_and_convert(buf, n, &my_charset_latin1, txt, + strlen(txt), &my_charset_utf8_bin, + &dummy_errors); buf[len]= '\0'; return 0; } // end of Decode @@ -398,9 +399,9 @@ xmlChar *LIBXMLDOC::Encode(PGLOBAL g, char *txt) buf = Buf; } // endif g uint dummy_errors; - uint32 len= copy_and_convert(buf, o, ocs, + uint32 len= copy_and_convert(buf, o, ocs, txt, i, ics, - &dummy_errors); + &dummy_errors); buf[len]= '\0'; return BAD_CAST buf; } // end of Encode diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index a480e6aafc5..d4cb0168ae7 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -904,22 +904,25 @@ int TDBXML::DeleteDB(PGLOBAL g, int irc) /***********************************************************************/ void TDBXML::CloseDB(PGLOBAL g) { - if (Changed) { - char filename[_MAX_PATH]; -// PDBUSER dup = (PDBUSER)g->Activityp->Aptr; + if (Docp) { + if (Changed) { + char filename[_MAX_PATH]; +// PDBUSER dup = (PDBUSER)g->Activityp->Aptr; - // We used the file name relative to recorded datapath - PlugSetPath(filename, Xfile, GetPath()); + // We used the file name relative to recorded datapath + PlugSetPath(filename, Xfile, GetPath()); - if (Mode == MODE_INSERT) - TabNode->AddText(g, "\n"); + if (Mode == MODE_INSERT) + TabNode->AddText(g, "\n"); - // Save the modified document - int rc = Docp->DumpDoc(g, filename); - } // endif Changed + // Save the modified document + int rc = Docp->DumpDoc(g, filename); + } // endif Changed + + // Free the document and terminate XML processing + Docp->CloseDoc(g, To_Xb); + } // endif docp - // Free the document and terminate XML processing - Docp->CloseDoc(g, To_Xb); } // end of CloseDB // ------------------------ XMLCOL functions ----------------------------