When Andy & Barney visit Otis in the Mt. Pilot jail, Barney is shown wearing his sidearm in the jail area. Unlike the Mayberry jail, the Mt. Pilot jail has more than two small cells. No firearms are allowed inside a jail pod.
Since Mayberry RFD is set in the early 1960s, it is possible that a corrections officer in a small town jail might carry his side arm in the facility. Based on the fact Andy keeps several rifles and shotguns unlocked on a gun rack in his facility even with prisoners in the cell. While today, it is common practice, back then the policy may have varied from jurisdiction to jurisdiction.
When Otis leaves the jail saying he'll not return, the calendar on the wall clearly has 31 days on it. When Andy and Barney go to Floyd's Barber Shop, the calendar on his wall has only 28.