Reformatting SQL statement in python module.
Improve log message information.
Adjustment to set legacy version for 1.{major_version}.