We report the detection of 21-cm and molecular hydrogen absorption lines in the same damped Lyman α system (DLA; with log
N(Hi) = 21.36±0.10) at
zabs= 3.17447 towards
SDSS J133724.69+315254.5 (
zem∼ 3.174). We estimate the spin temperature of the gas to be
TS= 600
+222–159K, intermediate between the expected values for cold and warm neutral media. This suggests that the Hi absorption originates from a mixture of different phases. The total molecular fraction is low, , and H
2 rotational level populations are not in equilibrium. The average abundance of the α-elements is [S/H] = -1.45±0.22. Nitrogen and iron are found underabundant with respect to α-elements by ∼1.0 and ∼0.5dex, respectively. Using photoionization models we conclude that the gas, of mean density
nH∼ 2/cm3, is located more than 270kpc away from the quasi-stellar object. While the position of the 21-cm absorption line coincides with the H
2 velocity profile, its centroid is shifted by ∼ 2.7±1.0 km/s^ with respect to the redshift measured from the H
2lines. However, the position of the strongest metal absorption component matches the position of the 21-cm absorption line within 0.5 km/s. From this, we constrain the variation of the combination of fundamental constants
x = α
2 Gp/µ, Δ
x/
x = - (1.7±1.7)x10
–6. This system is unique as we can at the same time have an independent constraint on µ using H
2lines. However, as the H
2 column density is low, only Werner band absorption lines are seen and, unfortunately, the range of sensitivity coefficients is too narrow to provide a stringent constraint: Δµ/µ ≤ 4.0x10
–4. The Ultraviolet and Visual Echelle Spectrograph spectrum reveals another DLA at
zabs= 3.16768 with log
N(Hi) = 20.41 ±0.15 and low metallicity, [Si/H] = -2.68±0.11, in which [O/C] ∼0.18 ±0.18 and [O/Si] ∼ 0. This shows that even in the very early stages of chemical evolution, the carbon or silicon to oxygen ratios can be close to solar. Using Voigt profile fitting we derive log(
N(Di)/
N(Hi)) = -(4.93±0.15) in this system. This is a factor of 2 smaller than the value expected from the best-fitting value of Ω
b from the
Wilkinson Microwave Anisotropy Probe 5-yr data. This confirms the presence of astration of deuterium even at very low metallicity.