I might be doing something stupid, but the following code produces a document with the first equation unnumbered (only an empty set of parentheses is given). The second equation is correctly numbered as 1.1.2. If I remove the change to \theequation, then everything is counted normally.
\documentclass[draft,fleqn,openany]{book}
\usepackage[tbtags]{amsmath}
\usepackage{amssymb}
\usepackage[no-math]{fontspec}
\usepackage{xkeyval}
\usepackage{polyglossia}
\setmainfont[BoldFont={* Bold},ItalicFont={* Italic},BoldItalicFont={* Bold Italic},SlantedFont={Linux Libertine Slanted O}]{Linux Libertine O}
\usepackage[letterpaper]{geometry}
\renewcommand{\theequation}{\numberwithin{equation}{section}}
\allowdisplaybreaks[1]
\setdefaultlanguage[variant=british]{english}
\begin{document}
\frontmatter
\title{A test document}
\author{AstroPig7}
\date{}
\maketitle
\tableofcontents
\mainmatter
\chapter{One}
Test document.
\section{Two}
Test document.
\begin{equation}
\text{Test.}
\end{equation}
\subsection{Three}
\begin{equation}
\text{Test.}
\end{equation}
\end{document}
I’ve also tried removing various non-essential declarations from the preamble with no success.
