22
yabbat
3y

Error Code: 1117. Too many columns

That must be one hell of a database design!

Comments
  • 5
    If that's MySQL, I'm to afraid to ask what has gone wrong here.
  • 7
  • 2
    @C0D4 it is mysql. stuff that nobody has touched since 2001. Just found it while I was importing some SQL dumps.
  • 2
    Note...

    MySQL MyISAM has a higher limit of columns than MySQL InnoDB.

    InnoDB is fixed to max. 1017 columns, MyISAM to _theoretically_ 4096.

    Theoretically as in both MyISAM and InnoDB the real maximum depends on other factors.

    If the backup is missing an explicit ENGINE statement in the DDL in backups, you might have done an implicit conversion of MyISAM to InnoDB.

    Implicit as the default table engine is dependent on server configuration.

    Fun stuff. If it's true, fix the backup script to be explicit as possible, cause you have true miraculous box of pandora in that case.
  • 1
    @lbfalvy
    Looks like there might still be a smidge of potential for normalization...
  • 1
    @Oktokolo The records represent locations in a large store chain. The GeneralOther columns are used differently depending on the values in other fields. GO3 indicates which of 4 size groups the location uses (represented by enum values 1, 2, 4 and 16 even though they are never combined for binary logical operations).

    Size 1 (tiny) stores three employees' IDs in GO4-7.

    Size 2 (small) stores a manager and up to five employees' IDs in GO4-10.

    Size 4 (medium) stores up to 8 employees' IDs in GO4-10 and 11-14 because GO10 is used for what looks like a money value but we never figured it out and

    Size 16 which is apparently not in the enum and referenced only as the literal 16 stores five managers in GO4-9 and a comma-separated list of employee IDs in GO9.

    Size 16 was called "huge", "massive" or "regional" in the spec and there was a two years old ticket with an empty description to implement "big". "big" wasn't in the spec and the manager didn't remember adding the ticket when I left.
  • 2
    @Oktokolo I and two of my friends were hired to finish the project when it was half a year overdue, but we spent most of our 1 year working there figuring out things like this and writing very elaborate comments and documents. The guys before us were supposedly experienced developers and we were high school students.
  • 1
    I messed up the column numbers a bit, the whole thing was a couple years ago and I'm reading this out of our old messenger group.
  • 3
    1 database 1 table
  • 0
    @admin1 one database, one table, one column containing an XML structure.

    👌
  • 0
    @kwilliams Burn, heathen, burn.

    Of course it must be JSON.
  • 0
    The kind of solutions that arise when the boss's son is involved.
Add Comment