Added comments for DB upgrade from v18 to v19.
Removed an unnecessary variable.
Removed an unnecessary variable 'check_version'.
Removed some redundant logic and code.
Removed a redundant lock.
Small clean up.
Removed constant 'NULL'.
Fix lock problem.
Fix import NULL.
Small clean up + Fix import NULL.
Added a new openDB() to replace old functions.
Replaced many methods including openDB().
Removed flag 'show_execute'.
Small fix + Small changes.
Removed two redundant methods.
Fix problems in openDb().
Small changes.