summaryrefslogtreecommitdiff
path: root/storage/connect/tabxml.cpp
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2013-03-29 01:28:48 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2013-03-29 01:28:48 +0100
commitdd8c89b2f44408e9e7c74ee990d88e8d9cd375de (patch)
tree571995e58081c12388ad045d9912d04f6949da53 /storage/connect/tabxml.cpp
parent0de0a46f0289e88901d3f6c78e185cfb6691faa5 (diff)
downloadmariadb-git-dd8c89b2f44408e9e7c74ee990d88e8d9cd375de.tar.gz
- Fix problems related to table file names when not specified:
Split unspecified VEC tables are no more allowed. Empty XML files are now accepted. Separate index files are now depending upon the SEPINDEX option and not allowed when file name is not specified. DROP now can erase table and index file. modified: storage/connect/ha_connect.cc storage/connect/tabdos.cpp storage/connect/tabxml.cpp
Diffstat (limited to 'storage/connect/tabxml.cpp')
-rw-r--r--storage/connect/tabxml.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp
index cb593d39857..9b8db7abbab 100644
--- a/storage/connect/tabxml.cpp
+++ b/storage/connect/tabxml.cpp
@@ -383,7 +383,7 @@ int TDBXML::LoadTableFile(PGLOBAL g)
return RC_FX;
} // endif init
- if (trace)
+ if (trace)
htrc("TDBXML: parsing %s rc=%d\n", filename, rc);
// Parse the XML file
@@ -391,8 +391,12 @@ int TDBXML::LoadTableFile(PGLOBAL g)
// Does the file exist?
int h= global_open(g, MSGID_NONE, filename, _O_RDONLY);
- rc = (h == -1 && errno == ENOENT) ? RC_NF : RC_INFO;
- if (h != -1) close(h);
+ if (h != -1) {
+ rc = (!_filelength(h)) ? RC_EF : RC_INFO;
+ close(h);
+ } else
+ rc = (errno == ENOENT) ? RC_NF : RC_INFO;
+
return rc;
} // endif Docp
@@ -487,8 +491,8 @@ bool TDBXML::Initialize(PGLOBAL g)
} else
TabNode = Root; // Try this ?
- } else if (rc == RC_NF) {
- // The XML file does not exist
+ } else if (rc == RC_NF || rc == RC_EF) {
+ // The XML file does not exist or is void
if (Mode == MODE_INSERT) {
// New Document
char buf[64];