You are viewing an old revision of this post, from November 11, 2014 @ 09:57:48. See below for differences between this version and the current revision.

[Magento Fix] SQLSTATE[22003]: Numeric value out of range: 1690 BIGINT UNSIGNED value is out of range

Last week, while working on a client’s Magento 1.7.x website, we were trying to delete all the catalogue products, but it did not happen and it kept on throwing this error,

 
1
SQLSTATE[22003]: Numeric value out of range: 1690 BIGINT UNSIGNED value is out of range in '(`magento_store`.`q`.`items_count` - 1)'

Here are three different options,which you can try one by one :

Option 1

 
1
DELETE FROM sales_flat_quote WHERE updated_at < DATE_SUB(Now(),INTERVAL 30 DAY);

Option 2

 
1
DELETE FROM sales_flat_quote WHERE customer_is_guest = 0;

Option 3

 
1
2
3
4
5
6
7
8
SET FOREIGN_KEY_CHECKS=0;
#truncate customer_sales_flat_quote;
#truncate customer_sales_flat_quote_address;
truncate flat_quote;
truncate flat_quote_item;
truncate flat_quote_address;
truncate flat_quote_shipping_rate;
SET FOREIGN_KEY_CHECKS=1;

Revisions

Revision Differences

November 11, 2014 @ 09:57:48Current Revision
Content
 Added: <div class="entry">
 Added: <p>
 Added: Last week, while working on a client&rsquo;s Magento 1.7.x website, we were trying to delete all the catalogue products, but it did not happen and it kept on throwing this error,
 Added: </p>
 Added: <div>
 Added: <div class="syntaxhighlighter php" id="highlighter_424290">
 Added: <div class="toolbar">
 Added: &nbsp;
 Added: </div>
 Added: <table border="0" cellpadding="0" cellspacing="0">
 Added: <tbody>
 Added: <tr>
 Added: <td class="gutter">
 Added: <div class="line number1 index0 alt2">
 Added: 1
 Added: </div>
 Added: </td>
 Added: <td class="code">
 Added: <div class="container">
 Added: <div class="line number1 index0 alt2">
Deleted: <div class="entry"><p>Last week, while working on a client’s Magento 1.7.x website, we were trying to delete all the catalogue products, but it did not happen and it kept on throwing this error, <span id="more-1218" ></span></p><div><div id="highlighter_424290" class="syntaxhighlighter php"><div class="toolbar"><span><a href="#" class="toolbar_item command_help help">?</a></ span></div><table border="0" cellpadding="0" cellspacing=" 0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="php plain">SQLSTATE[22003]: Numeric value out of range: 1690 BIGINT UNSIGNED value is out of range in </code><code class="php string">'(`magento_ store`.`q`.`items_count` - 1)'</code></div> </div></td></ tr></tbody>< /table></div> </div><p>Here are three different options,which you can try one by one :</p><h3>Option 1</h3><div><div id="highlighter_31033" class="syntaxhighlighter php"><div class="toolbar"><span><a href="#" class="toolbar_item command_help help">?</a></ span></div><table border="0" cellpadding="0" cellspacing=" 0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="php functions">DELETE</code> <code class="php plain">FROM sales_flat_quote WHERE updated_at &lt; DATE_SUB(Now(),INTERVAL 30 DAY);</code>< /div></div></ td></tr></tbody> </table></div> </div><h3>Option 2</h3><div><div id="highlighter_967194" class="syntaxhighlighter php"><div class="toolbar"><span><a href="#" class="toolbar_item command_help help">?</a></ span></div><table border="0" cellpadding="0" cellspacing=" 0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="php functions">DELETE</code> <code class="php plain">FROM sales_flat_quote WHERE customer_is_guest = 0;</code></div> </div></td></ tr></tbody>< /table></div> </div><h3>Option 3</h3><div><div id="highlighter_537361" class="syntaxhighlighter php"><div class="toolbar"><span><a href="#" class="toolbar_item command_help help">?</a></ span></div><table border="0" cellpadding="0" cellspacing=" 0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div><div class="line number2 index1 alt1">2</div><div class="line number3 index2 alt2">3</div><div class="line number4 index3 alt1">4</div><div class="line number5 index4 alt2">5</div><div class="line number6 index5 alt1">6</div><div class="line number7 index6 alt2">7</div><div class="line number8 index7 alt1">8</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="php plain">SET FOREIGN_KEY_CHECKS= 0;</code></div><div class="line number2 index1 alt1"><code class="php plain">#truncate customer_sales_ flat_quote;</ code></div><div class="line number3 index2 alt2"><code class="php plain">#truncate customer_sales_ flat_quote_address; </code></div><div class="line number4 index3 alt1"><code class="php plain">truncate flat_quote;</ code></div><div class="line number5 index4 alt2"><code class="php plain">truncate flat_quote_item; </code></div><div class="line number6 index5 alt1"><code class="php plain">truncate flat_quote_address; </code></div><div class="line number7 index6 alt2"><code class="php plain">truncate flat_quote_shipping_ rate;</code></div><div class="line number8 index7 alt1"><code class="php plain">SET FOREIGN_KEY_CHECKS= 1;</code></div></div></td> </tr></tbody> </table></div> </div></div>Added: <code class="php plain">SQLSTATE[22003]: Numeric value out of range: 1690 BIGINT UNSIGNED value is out of range in </code><code class="php string">&#039; (`magento_store`.`q`.`items_count` - 1)&#039;</code>
 Added: </div>
 Added: </div>
 Added: </td>
 Added: </tr>
 Added: </tbody>
 Added: </table>
 Added: </div>
 Added: </div>
 Added: <p>
 Added: Here are three different options,which you can try one by one :
 Added: </p>
 Added: <h3>
 Added: Option 1
 Added: </h3>
 Added: <div>
 Added: <div class="syntaxhighlighter php" id="highlighter_31033">
 Added: <div class="toolbar">
 Added: &nbsp;
 Added: </div>
 Added: <table border="0" cellpadding="0" cellspacing="0">
 Added: <tbody>
 Added: <tr>
 Added: <td class="gutter">
 Added: <div class="line number1 index0 alt2">
 Added: 1
 Added: </div>
 Added: </td>
 Added: <td class="code">
 Added: <div class="container">
 Added: <div class="line number1 index0 alt2">
 Added: <code class="php functions">DELETE</code> <code class="php plain">FROM sales_flat_quote WHERE updated_at &lt; DATE_SUB(Now(),INTERVAL 30 DAY);</code>
 Added: </div>
 Added: </div>
 Added: </td>
 Added: </tr>
 Added: </tbody>
 Added: </table>
 Added: </div>
 Added: </div>
 Added: <h3>
 Added: Option 2
 Added: </h3>
 Added: <div>
 Added: <div class="syntaxhighlighter php" id="highlighter_967194">
 Added: <div class="toolbar">
 Added: &nbsp;
 Added: </div>
 Added: <table border="0" cellpadding="0" cellspacing="0">
 Added: <tbody>
 Added: <tr>
 Added: <td class="gutter">
 Added: <div class="line number1 index0 alt2">
 Added: 1
 Added: </div>
 Added: </td>
 Added: <td class="code">
 Added: <div class="container">
 Added: <div class="line number1 index0 alt2">
 Added: <code class="php functions">DELETE</code> <code class="php plain">FROM sales_flat_quote WHERE customer_is_guest = 0;</code>
 Added: </div>
 Added: </div>
 Added: </td>
 Added: </tr>
 Added: </tbody>
 Added: </table>
 Added: </div>
 Added: </div>
 Added: <h3>
 Added: Option 3
 Added: </h3>
 Added: <div>
 Added: <div class="syntaxhighlighter php" id="highlighter_537361">
 Added: <div class="toolbar">
 Added: &nbsp;
 Added: </div>
 Added: <table border="0" cellpadding="0" cellspacing="0">
 Added: <tbody>
 Added: <tr>
 Added: <td class="gutter">
 Added: <div class="line number1 index0 alt2">
 Added: 1
 Added: </div>
 Added: <div class="line number2 index1 alt1">
 Added: 2
 Added: </div>
 Added: <div class="line number3 index2 alt2">
 Added: 3
 Added: </div>
 Added: <div class="line number4 index3 alt1">
 Added: 4
 Added: </div>
 Added: <div class="line number5 index4 alt2">
 Added: 5
 Added: </div>
 Added: <div class="line number6 index5 alt1">
 Added: 6
 Added: </div>
 Added: <div class="line number7 index6 alt2">
 Added: 7
 Added: </div>
 Added: <div class="line number8 index7 alt1">
 Added: 8
 Added: </div>
 Added: </td>
 Added: <td class="code">
 Added: <div class="container">
 Added: <div class="line number1 index0 alt2">
 Added: <code class="php plain">SET FOREIGN_KEY_CHECKS=0;</code>
 Added: </div>
 Added: <div class="line number2 index1 alt1">
 Added: <code class="php plain">#truncate customer_sales_ flat_quote;</code>
 Added: </div>
 Added: <div class="line number3 index2 alt2">
 Added: <code class="php plain">#truncate customer_sales_ flat_quote_address;</code>
 Added: </div>
 Added: <div class="line number4 index3 alt1">
 Added: <code class="php plain">truncate flat_quote;</code>
 Added: </div>
 Added: <div class="line number5 index4 alt2">
 Added: <code class="php plain">truncate flat_quote_item;</code>
 Added: </div>
 Added: <div class="line number6 index5 alt1">
 Added: <code class="php plain">truncate flat_quote_address;</code>
 Added: </div>
 Added: <div class="line number7 index6 alt2">
 Added: <code class="php plain">truncate flat_quote_shipping_ rate;</code>
 Added: </div>
 Added: <div class="line number8 index7 alt1">
 Added: <code class="php plain">SET FOREIGN_KEY_CHECKS=1;</code>
 Added: </div>
 Added: </div>
 Added: </td>
 Added: </tr>
 Added: </tbody>
 Added: </table>
 Added: </div>
 Added: </div>
 Added: </div>

Note: Spaces may be added to comparison text to allow better line wrapping.

3 Responses to “[Magento Fix] SQLSTATE[22003]: Numeric value out of range: 1690 BIGINT UNSIGNED value is out of range”

  1. Cialis generic 26/03/2018 at 6:04 pm #

    Hi! I just wanted to ask if you ever have any trouble with hackers? My last blog (wordpress) was hacked and I ended up losing months of hard work due to no backup. Do you have any solutions to protect against hackers?

  2. Dimple Wardrip 30/05/2018 at 5:03 am #

    I just got done eating a platter of spaghetti before visiting your site. It sure makes the full feeling all that much better.

Leave a Reply