As far as I know, a function $f$ defined on an interval $[a, b]$ is said to be of bounded variation if $$\tag{1}V_a^b(f)=\sup\left\{\sum_{P} \lvert f(x_{j+1})-f(x_j)\rvert \ :\ P\ \text{partition of }[a, b]\right\}<\infty.$$ Today I discovered that another definition is in use for a function defined in an open subset $\Omega$ of $\mathbb{R}^n$, namely (cfr. Wikipedia) we say that $f$ is of bounded variation if $$\tag{2}V(f; \Omega)=\sup\left\{ \int_{\Omega}f(x)\,\text{div}\,\phi (x)\, dx\ :\ \phi\in C^1_c(\Omega),\ \lVert \phi\rVert_{\infty}\le 1 \right\}<\infty.$$
Even if the cited Wikipedia article treats the two definitions as if they were equivalent when $\Omega=(a, b)$, this does not seem to me to be the case. The Dirichlet function $\chi_{\mathbb{Q}\cap [0, 1]}$ is not of bounded variation in $(0, 1)$ in the sense of definition (1) but it is in the sense of definition (2).
Question. What is the precise relationship between the two definitions?
Thank you for reading.