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

Many thanks to Ray Bon for finding the problem