Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Table Copy Bug

forums forums SQLyog SQLyog: Bugs / Feature Requests Table Copy Bug

  • This topic is empty.
Viewing 0 reply threads
  • Author
    Posts
    • #12756
      tfurry
      Member

      Not sure if this is a bug or not or just a problem with MySQL in general.

      I use several tables with PKs that are auto-incrementing unsigned integers. Usually I don't use a 0, but sometimes I do. If I do, the table throws an error when duplicated.

      To duplicate the problem, create a simple table with an integer column and set it to PK, Not Null, Unsigned and Auto-Increment. Make a couple of entries and set one of the PKs to 0 (which is a valid unsigned value). Then attempt to duplicate the table. It'll throw an error 1062, “Duplicate entry '1' for key 1”. Oddly, the duplication will actually create the copy (just cancel out of the error message), but the copy will have a Default value of 0 for the PK column and the column will not be Auto Incrementing. I can't get the copied table set back to Auto Increment unless I remove both the Default value and set the table row with the 0 PK to another number.

      I usually use these tables for reference lookups, with the 0 being the default value for display. Not a big deal, but an odd error.

Viewing 0 reply threads
  • You must be logged in to reply to this topic.