  This work addresses the effects of different thermal sidewall boundary
conditions on the formation of flow states and heat transport in two- and
three-dimensional Rayleigh--B\'enard convection (RBC) by means of direct
numerical simulations and steady-state analysis for Rayleigh numbers $Ra$ up to
$4\times10^{10}$ and Prandtl numbers $Pr=0.1,1$ and $10$. We show that a linear
temperature profile imposed at the conductive sidewall leads to a premature
collapse of the single-roll state, whereas a sidewall maintained at a constant
temperature enhances its stability. The collapse is caused by accelerated
growth of the corner rolls with two distinct growth rate regimes determined by
diffusion or convection for small or large $Ra$, respectively. Above the
collapse of the single-roll state, we find the emergence of a double-roll state
in two-dimensional RBC and a double-toroidal state in three-dimensional
cylindrical RBC. These states are most prominent in RBC with conductive
sidewalls. The different states are reflected in the global heat transport, so
that the different thermal conditions at the sidewall lead to significant
differences in the Nusselt number for small to moderate $Ra$. However, for
larger $Ra$, heat transport and flow dynamics become increasingly alike for
different sidewalls and are almost indistinguishable for $Ra>10^9$. This
suggests that the influence of imperfectly insulated sidewalls in RBC
experiments is insignificant at very high $Ra$ - provided that the mean
sidewall temperature is controlled.
