The definition of the structure sheaf of an affine scheme $\operatorname{Spec} R$ is often done by extending a sheaf defined on the standard opens $D(f)$, $f\in R$. From this definition it is not quite clear what the rings $\mathcal{O}(U)$ look like for general $U\subset \operatorname{Spec} R$. As Ravi Vakil notes in the lecture notes, one might hope that $$\mathcal{O}(U)\cong R_S$$ where $$S=\{r\in R\mid \forall \mathfrak{p}\in U: r\not\in \mathfrak{p}\}$$ He also notes that this is not true, and gives an example of two planes intersecting at a point, and then removing the point. More precisely $$X=\operatorname{Spec} \mathbb{C}[w,x,y,z]/(wy,wz,xy,xz), U=X\setminus\{(w,x,y,z)\}$$ But $U$ is clearly the union of two open subsets: $U_1$ the $xw$-plane with the origin removed and $U_2$ the $yz$-plane with the origin removed. So then one can construct sections on $U_1$ and $_2$ separately and glue them to a section on $U$. This makes it clear the $\mathcal{O}(U)$ is not a localisation of $\mathbb{C}[w,x,y,z]/(wy,wz,xy,xz)$.
However, this example is in some sense trivial in that it relies upon the fact that if $U$ is a disjoint union of $U_1$ and $U_2$ then $$\mathcal{O}(U)=\mathcal{O}(U_1)\times \mathcal{O}(U_2)$$ So I wonder if there are examples that do not rely on this fact. So if there is an affine scheme $\operatorname{Spec} R$ with an irreducible open subset $U$ such that $\mathcal{O}(U)$ is not a localisation of $R$.
Edit: another way of looking at the same question is by taking Hartshornes perspective. Sections over $U$ are maps to the stalks that can locally be realised by fractions. So is there an example of an irreducible $U$ and a section $s:U\to \bigcup_{\mathfrak{p}\in U}R_\mathfrak{p}$ so that locally $s=\frac{g}{h}$, but it is not possible to write $s$ like this on all of $U$?