Improve a dump of the primary key support.

This PR will fixes #14169, #16599.
If it is not a default primary key, correctly dump the type and options.