MDL-40883 ddl: make sure object name never exceeds max length

Many thanks to Ray Bon for finding the problem