#12051: merge with 3.1.