Revamp commandline construction and string handling in cbd_restore_agent
This patch started out as a small refactor of executable discovery due to the function having multiple leaks, but turned into a revamping of the way the commandlines are constructed (since that's where the executable paths were used). The changes introduced in this diff are: - Build the commandlines in PQExpBuffers instead of fixed size buffer believed to be large enough - Move commandline functions from cdb_dump_util into cdb_restore_agent as that's the only callsite, no need to link that code into other binaries. Also refactor the functions significantly as there were many functions doing essentially the same thing. - Remove code to find executables and just use find_other_exec() since all binaries are in the same folder - Change shellEscape() to not always resetting the PQExpBuffer, also use the same code as in src/backend/cdb/cdbbackup.c which handles quoting as well - Remove various small functions that only returned a static string and variables holding a static string - Use MAXPGPATH instead of locally defined macro for the same thing - Remove the highly uninteresting unittests for string concatenation
Showing
想要评论请 注册 或 登录