Strange Database Problem

I have been working with imports to add some products to my cart and I noticed a database problem which could be due to corruption, but I'm not sure.



CS-cart says that there are 1558 products: 1491 active, 3 hidden and 64 disabled. That's well and good, but when I export a CSV I have 1560 rows. There are three consecutive rows with Product code 12561 and Product id 2131, so the error “adds up”. The CSV file has no garbage in it: every line ends with a new line char and all tabs are present in all lines. What does the fact that all three lines with Product code 12561 have the same Product id indicate? Seems to me that it means the problem occurred during export. Any ideas or suggestions appreciated.

Backed up and ran optimize several times, yet problem persists.

have u checked database in phpmyadmin



John

[quote name='johnbol1' timestamp='1413720849' post='194558']

have u checked database in phpmyadmin



John

[/quote]

No, haven't done that but will do so. Thanks.

Product ID is a unique, auto-incremented field in the Product table, so you won't find more than one instance of any Product ID in the database table.

[quote name='Magpie Don' timestamp='1413745947' post='194566']

Product ID is a unique, auto-incremented field in the Product table, so you won't find more than one instance of any Product ID in the database table.

[/quote]

Unless of course the corruption (or change) has turned auto increment off.

It doesn't seem like duplicate product ids in the database. Seems like triplicate rows for that product id in the CSV export, which has two more rows than CS-Cart's product count.

Are you using options inventory for for that product_id?

[quote name='tbirnseth' timestamp='1413840864' post='194660']

Are you using options inventory for for that product_id?

[/quote]



“Track without options.”



I just exported the offending record only and manually edited the CSV, deleting the two extra rows. I then tried to import the edited CSV and the import hung.

Perhaps I should try deleting the record and adding again. Is there a way to regenerate the entire database?



I deleted the record and added a new one with the same data. Seems to have fixed things. What was strange is that we didn't see anything wrong with the database.

[quote name='johnbol1' timestamp='1413720849' post='194558']

have u checked database in phpmyadmin



John

[/quote]

[quote name='Magpie Don' timestamp='1413745947' post='194566']

Product ID is a unique, auto-incremented field in the Product table, so you won't find more than one instance of any Product ID in the database table.

[/quote]

[quote name='tbirnseth' timestamp='1413840864' post='194660']

Are you using options inventory for for that product_id?

[/quote]



Update: Now I am unable to import images and getting import error messages which are obviously incorrect, such as one telling me that I must have fields Product code and Pair type in my image import CSV when I already have them. Also, although the database backup process seems to hang around 85% through the process (as far as “backing up data for: cs-cart_stat_requests”) it seems to finish after some minutes. After running database optimize I am still unable to import images with a CSV file and get the missing fields message even though the import CSV is as required after double checking. The database needs a thorough testing.



ps- I can't be certain but the problem seemed to start after activating Suppliers add-on, which itself seemed to be behaving strangely.