i just installed magento 1.91 with sample product data, when i delete products in batch, there is an error message in backend in red alert box

SQLSTATE[22003]: Numeric value out of range: 1690 BIGINT UNSIGNED value is out of range in '(`m1`.`q`.`items_count` - 1)', query was: UPDATE `sales_flat_quote` AS `q` INNER JOIN `sales_flat_quote_item` AS `qi` ON q.entity_id = qi.quote_id AND qi.parent_item_id IS NULL AND qi.product_id = 432 SET `q`.`items_qty` = `q`.`items_qty` - `qi`.`qty`, `q`.`items_count` = `q`.`items_count` - 1

i've found this issue in official forum


i need to run

UPDATE sales_flat_quote_item qi 
INNER JOIN sales_flat_quote q 
ON qi.quote_id = q.entity_id 
SET q.items_count = 1 
WHERE q.items_count = 0 
AND qi.product_id = PRODUCT_ID

for every single product when i encounter this error message, it there any method i can solve this problem at one time (for example, change the mysql config?)


I've been searching for the solution to this for awhile and finally found a great resource that works! https://www.golocalexpert.com/resolving-the-infamous-magento-deleting-issue-sqlstate22003-numeric-value-out-of-range-1690-bigint-unsigned-value-is-out-of-range-in-yourdbname-q-items_count-1/

I had a new Magento install that included all of the Demo products, categories, etc and couldn't bulk delete anything without that same error happening. I'm also running the Enhanced Product Grid extension (Free!) which I highly recommend for bulk updating products and moving them around between categories and such.

Hopefully this helps for you! I'm by no means a coding expert but managed to follow these directions with ease thru my GoDaddy hosting backend where I got into the MyPHP and was able to go from there.

  • 1
    Changing Magento's default database structure is not a good idea! – Simon Sep 18 '15 at 10:38
  • You should try to write at least a summary about the article linked in case it disappears in the future. – Mir Feb 11 at 11:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.