The World Pool-Billiard Association has the following rules:
3.4 Open Table / Choosing Groups:
Before groups are determined, the table is said to be “open,” and before each shot, the shooter must call his intended ball. If the shooter legally pockets his called ball, the corresponding group becomes his, and his opponent is assigned the other group. If he fails to legally pocket his called ball, the table remains open and play passes to the other player. When the table is “open”, any object ball may be struck first except the eight ball.
A "legal" shot is defined in Rule 8.2, Shot:
A shot begins when the tip contacts the cue ball due to a forward stroke motion of the cue stick. A shot ends when all balls in play have stopped moving and spinning. A shot is said to be legal if the shooter did not foul during the shot.
And, of course, pocketing the Cue Ball is a foul, under Rule 6.1, Cue Ball Scratch or off the Table:
If the cue ball is pocketed or driven off the table, the shot is a foul. See 8.3 Ball Pocketed and 8.5 Driven off the Table.
So, in the situation you've described, the shooter fouled since they pocketed the cue ball (Rule 6.1). Therefore the shot was not legal (Rule 8.2), therefore the table is still open since the shooter "[failed] to legally pocket his called ball" (Rule 3.4).