24/7 Support - 800.608.6482

Miva Merchant Community Forums

  1. #1
    Join Date
    Mar 2006
    Posts
    1,869

    Default 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. #2
    Join Date
    Aug 2007
    Location
    Atlanta, GA
    Posts
    765

    Default 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

  3. #3
    Join Date
    Mar 2006
    Posts
    1,869

    Default 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

  4. #4
    Join Date
    Jul 2008
    Location
    NE Ohio - Go Cavs!
    Posts
    948

    Default 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.

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •