This article is from the U.S. Civil War FAQ, by Justin M. Sanders email@example.com with numerous contributions by others.
Texas *was not* brought into the Union by treaty. There was an attempt
to do this in 1844, but the U.S. Senate refused to ratify the treaty.
Texas was annexed by a Joint Resolution of Congress in 1845.
Neither the failed annexation treaty nor the Resolution of Annexation
reserved any right for Texas to secede. In fact, the treaty would have
made Texas a mere territory, but the Joint Resolution gave immediate
statehood. In addition, the Resolution provided that Texas might divide
itself into as many as five states, if it so desired. In 1845, Texas did
not avail itself of this provision of the Resolution, and it is not clear
whether the provision would still be operable after that time.