Announcement

Collapse
No announcement yet.

Strange MySQL error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Strange MySQL error

    Hi folks --

    One of my clients recently reported this error message from one of my custom modules:
    Code:
    ERROR writing session database: mysql_execute: Duplicate entry 'e4208341d66e7646cdf6881c789dda03' for key 's01_ReorderSessions_i'
    As you guessed, the table is keyed by session ID. But the index does NOT have the Unique attribute turned on. So why did the store get a duplicate-entry error? Could this be a server bug? Should I tell them to run some diagnostics?

    Thanks --
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    #2
    Re: Strange MySQL error

    Hi Kent,

    Check the actual MySQL server index via phpMyAdmin, I'd bet it was created UNIQUE. Maybe an older version of the module declared it unique on install.

    Best,
    James
    James Harrell
    current: Friend of Miva
    2007-2012 eMediaSales & Viking Coders
    2005-2007 Miva Merchant
    2001-2005 Copernicus

    Comment


      #3
      Re: Strange MySQL error

      Thanks for the suggestion; but actually, I did check it with phpMyAdmin. The Unique setting is not turned on for that index.
      Kent Multer
      Magic Metal Productions
      http://TheMagicM.com
      * Web developer/designer
      * E-commerce and Miva
      * Author, The Official Miva Web Scripting Book -- available on-line:
      http://www.amazon.com/exec/obidos/IS...icmetalproducA

      Comment


        #4
        Re: Strange MySQL error

        I've seen this when an autoincrement is failing (like the primary key isn't "NULL" inserted) but I'm also used to seeing a "UNIQUE key" when that part fails, so I wouldn't think it's a "unique key" issue. Also seen this happen when the data type for the field was incorrect - like a tinyint when it should have been a bigger int. Same error is thrown, even though that wasn't **truly** the problem.

        Comment

        Working...
        X