I am trying to compile Berkeley DB version 5.3.15 with BDBSQL_FILE_PER_TABLE flag to store each table created in DBSQL as a seperate file.
The issue I am facing is that all the table files along with the metadata file are being created outside the "database location". The issue does not exist with Berkeley DB version 5.2.
After looking into the file "sqlite3.c" I figured the problem was present in the function "btreePrepareEnvironment" in the following portion of the code.
/* Reuse envDirNameBuf. */
dirPathName = dirPathBuf;
memset(dirPathName, 0, BT_MAX_PATH);
*//sqlite3_snprintf(sizeof(dirPathName), dirPathName, // The size of dirPathName = 4. only "../" portion was getting copied to dirPathName variable.*
sqlite3_snprintf(sizeof(dirPathBuf), dirPathName, // TEMP FIX
Please let me know if this is a sufficient fix. Also can I get an official patch for the fix?
Thanks for reporting this. Your fix looks reasonable.
I can create and email and official patch for you. If you email me directly at alexander dot gorrod at oracle dot com, I will respond with the patch.
Oracle Berkeley DB