simply checking flag bitmasks
use new implementation of CmdCheckBatch
complete copy_cdb(); introduce a GCC #pragma; fix uninitialized argument warning
copy_cdb(): check access to source db