The problem comes from Hartshorne's Algebraic Geometry, Chapter III, Proposition 9.2. Here is the description:
(b) Base change: let $f: X \longrightarrow Y$ be a morphism of schemes, let $\mathscr{F}$ be an $O_X$-module which is flat over $Y$, and let $g : Y \longrightarrow Y'$ be any morphism of schemes. Let $X' = X \times_Y Y'$, let $f' : X' \longrightarrow Y'$ be the second projection, and let $\mathscr{F}' = p_1^* (\mathscr{F})$. Then $\mathscr{F}'$ is flat over $Y'$.
(d) Let $A \longrightarrow B$ be a ring homomorphism, and let $M$ be a $B$-module. Let $f: X= \operatorname{Spec} B \longrightarrow Y = \operatorname{Spec} A$ be the corresponding morphism of affine schemes, and let $\mathscr{F} = \tilde{M}$. Then $\mathscr{F}$ is flat over $Y$ iff $M$ is flat over $A$.
(d) is easy. How to prove (b)?
If $\mathscr{F}$ is quasi-coherent, then I can deduce (b) from (d) immediately. But generally, $\mathscr{F}$ is not quasi-coherent. I also notice the stalk of fibre product is not just a tensor product as I want.