cancel
Showing results for 
Search instead for 
Did you mean: 

HELP error SQLSTATE[22003]: Numeric value out of range: 167 Out of range value for column 'flag_id'

SOLVED

HELP error SQLSTATE[22003]: Numeric value out of range: 167 Out of range value for column 'flag_id'

I wonder how it wasn't discussed before, but i'm constantly getting this error and have no clue why it happens. Please let me know if there's anything can be done with this problem.

 

This shows then I am trying to edit/save any product in back-end.

After saving/editing product, it showing wrong in layered navigation in front-end catalog.

Listing by price is not working correct.

This product comes in front of other category products in list view. (I am using sorting by price).

Also I cant manage stock.

 

Error in backend:

SQLSTATE[22003]: Numeric value out of range: 167 Out of range value for column 'flag_id' at row 1

Tags (1)
3 REPLIES

Re: HELP error SQLSTATE[22003]: Numeric value out of range: 167 Out of range value for column 'flag_

That's quite an old version of Magento you've got going there! 

 

I've not seen this error before and I can't find much about it online.  I'd try and try and find a bit more information about the query that's being run. If you have a MySQL query log that you can enable temporarily, that would be useful.  

 

`flag_id` could be a reference to a column in a core_flag table. This column should have a wider range than 167 as by default its a small int. Would you be able look at the results of `DESCRIBe core_flag` to see what it says about the type of the flag_id column?

 

If there a full stack trace in your var/log/exception.log or system.log file? If logging isn't enabled it would be worth enabling in case it gives us a stack trace. 

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

Re: HELP error SQLSTATE[22003]: Numeric value out of range: 167 Out of range value for column 'flag_

Hi, yes I can check all You wrote. I realized that problem is in this care_flag table.

Maybe because of SMALLINT (5)?

"MySQL is simply setting the (displayed) length of the column to match he data type (max value 65535, five digits). "

 

`DESCRIBe core_flag` results:

 

j1.jpg


var/log/exception.log or system.log file?

What shoud I look for in these files?
I can open it, but don't know what to look for? I found this about flag_id:

Exception message: SQLSTATE[22003]: Numeric value out of range: 167 Out of range value for column 'flag_id' at row 1
Trace: #0 /home/buitis/domains/buitis.lt/public_html/lib/Zend/Db/Statement.php(283): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/buitis/domains/buitis.lt/public_html/lib/Zend/Db/Adapter/Abstract.php(457): Zend_Db_Statement->execute(Array)
#2 /home/buitis/domains/buitis.lt/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(230): Zend_Db_Adapter_Abstract->query('INSERT INTO `co...', Array)
#3 /home/buitis/domains/buitis.lt/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(281): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `co...', Array)
#4 /home/buitis/domains/buitis.lt/public_html/lib/Zend/Db/Adapter/Abstract.php(535): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `co...', Array)
#5 /home/buitis/domains/buitis.lt/public_html/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(369): Zend_Db_Adapter_Abstract->insert('core_flag', Array)
#6 /home/buitis/domains/buitis.lt/public_html/app/code/core/Mage/Core/Model/Abstract.php(251): Mage_Core_Model_Mysql4_Abstract->save(Object(Mage_CatalogIndex_Model_Catalog_Index_Flag))
#7 /home/buitis/domains/buitis.lt/public_html/app/code/core/Mage/CatalogIndex/Model/Indexer.php(192): Mage_Core_Model_Abstract->save()
#8 /home/buitis/domains/buitis.lt/public_html/app/code/core/Mage/CatalogIndex/Model/Observer.php(100): Mage_CatalogIndex_Model_Indexer->plainReindex(Object(Mage_Catalog_Model_Product))
#9 /home/buitis/domains/buitis.lt/public_html/app/code/core/Mage/Core/Model/App.php(1239): Mage_CatalogIndex_Model_Observer->processAfterSaveEvent(Object(Varien_Event_Observer))
#10 /home/buitis/domains/buitis.lt/public_html/app/Mage.php(303): Mage_Core_Model_App->dispatchEvent('catalog_product...', Array)
#11 /home/buitis/domains/buitis.lt/public_html/app/code/core/Mage/Core/Model/Abstract.php(292): Mage::dispatchEvent('catalog_product...', Array)
#12 /home/buitis/domains/buitis.lt/public_html/app/code/core/Mage/Catalog/Model/Product.php(499): Mage_Core_Model_Abstract->_afterSave()
#13 /home/buitis/domains/buitis.lt/public_html/app/code/core/Mage/Core/Model/Abstract.php(252): Mage_Catalog_Model_Product->_afterSave()
#14 /home/buitis/domains/buitis.lt/public_html/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(596): Mage_Core_Model_Abstract->save()
#15 /home/buitis/domains/buitis.lt/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(376): Mage_Adminhtml_Catalog_ProductController->saveAction()
#16 /home/buitis/domains/buitis.lt/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(248): Mage_Core_Controller_Varien_Action->dispatch('save')
#17 /home/buitis/domains/buitis.lt/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(158): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#18 /home/buitis/domains/buitis.lt/public_html/app/Mage.php(459): Mage_Core_Controller_Varien_Front->dispatch()
#19 /home/buitis/domains/buitis.lt/public_html/index.php(65): Mage::run()
#20 {main}
2017-12-10T09:50:19+00:00 DEBUG (7):

 

Any Ideas?

Re: HELP error SQLSTATE[22003]: Numeric value out of range: 167 Out of range value for column 'flag_

SOLVED

Just empty this table..

TRUNCATE core_flag

 

 Now everything work fineSmiley Happy