title: Bad SQL query Disk full (/tmp/#sql_58f_0); waiting for someone to free some space
body: <p>I have Presta, and I like it but..
  Now I get this strange error:</p>
  
  <blockquote>
    <p>Bad SQL query Disk full (/tmp/#sql_58f_0); waiting for someone to free
    some space...</p>
  </blockquote>
  
  <p>I googled a lot, but did not find any solution.</p>
  
  <p>After I added EAN codes in my products field, my shop shows:</p>
  
  <blockquote>
    <p>No featured products at this time.</p>
  </blockquote>
  
  <p>Prior to this all seemed to look fine.
  I restored an old backup (from 2 months ago) and noticed that it already did had the same SQL error and after I added one EAN code, I see the same <strong>no featured products</strong>.</p>
  
  <p>Not sure if the restore placed the shop back in 100 old condition, but with ean code's I have a total non working shop.
  Even removing them dos not solve my problem.</p>
  
  <p>I turned on debugging and received this as result: </p>
  
  <pre><code>{PrestaShopDatabaseException]
  
  Disk full (/tmp/#sql_58f_0); waiting for someone to free some space...
  
  SELECT
  a.`id_category`, `name`, `description`, sa.`position` AS `position`, `active`
  , sa.position position
  FROM `ps_category` a 
  LEFT JOIN `ps_category_lang` b ON (b.`id_category` = a.`id_category` AND b.`id_lang` = 1 AND b.`id_shop` = 1)
  LEFT JOIN `ps_category_shop` sa ON (a.`id_category` = sa.`id_category` AND sa.id_shop = 1)  
  WHERE 1   AND `id_parent` = 2 
  
  ORDER BY sa.`position` ASC  LIMIT 0, 50
  </code></pre>
  
  <hr>
  
  <p>at line 791 in file classes/db/Db.php:</p>
  
  <pre><code>786.         if ($webservice_call &amp;&amp; $errno) {
  787.             $dbg = debug_backtrace();
  788.             WebserviceRequest::getInstance()-&gt;setError(500, '[SQL Error] '.$this-&gt;getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'-&gt;'.$dbg[3]['function'].'() Query was : '.$sql, 97);
  789.         } elseif (_PS_DEBUG_SQL_ &amp;&amp; $errno &amp;&amp; !defined('PS_INSTALLATION_IN_PROGRESS')) {
  790.             if ($sql) {
  
  **791.                 throw new PrestaShopDatabaseException($this-&gt;getMsgError().'&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;'.$sql.'&lt;/pre&gt;');**
  
  792.             }
  793. 
  794.             throw new PrestaShopDatabaseException($this-&gt;getMsgError());
  795.         }
  796.     }
  </code></pre>
  
  <hr>
  
  <pre><code>DbCore-&gt;displayError - [line 425 - classes/db/Db.php] - [1 Arguments]
  
  420.                 $this-&gt;result = $this-&gt;_query($sql);
  421.             }
  422.         }
  423. 
  424.         if (_PS_DEBUG_SQL_) {
  
  **425.             $this-&gt;displayError($sql);**
  
  426.         }
  427. 
  428.         return $this-&gt;result;
  429.     }
  430. 
  </code></pre>
  
  <hr>
  
  <pre><code>DbCore-&gt;query - [line 643 - classes/db/Db.php] - [1 Arguments]
  
  Argument [0]
  SELECT
  a.`id_category`, `name`, `description`, sa.`position` AS `position`, `active`
  , sa.position position
  FROM `ps_category` a 
  LEFT JOIN `ps_category_lang` b ON (b.`id_category` = a.`id_category` AND b.`id_lang` = 1 AND b.`id_shop` = 1)
  LEFT JOIN `ps_category_shop` sa ON (a.`id_category` = sa.`id_category` AND sa.id_shop = 1)  
  WHERE 1   AND `id_parent` = 2 
  
  ORDER BY sa.`position` ASC  LIMIT 0, 50
  </code></pre>
  
  <hr>
  
  <pre><code>DbCore-&gt;executeS - [line 3212 - classes/controller/AdminController.php] - [3 Arguments]
  
  3207. '.($this-&gt;_tmpTableFilter ? ' * FROM (SELECT ' : '').$this-&gt;_listsql.$sql_from.$sql_join.' WHERE 1 '.$sql_where.
  3208.                                 $sql_order_by.$sql_limit;
  3209.                 $list_count = 'SELECT COUNT(*) AS `'._DB_PREFIX_.$this-&gt;table.'` '.$sql_from.$sql_join.' WHERE 1 '.$sql_where;
  3210.             }
  3211. 
  
  **3212.             $this-&gt;_list = Db::getInstance()-&gt;executeS($this-&gt;_listsql, true, false);**
  
  3213. 
  3214.             if ($this-&gt;_list === false) {
  3215.                 $this-&gt;_list_error = Db::getInstance()-&gt;getMsgError();
  3216.                 break;
  3217.             }
  </code></pre>
  
  <hr>
  
  <pre><code>AdminControllerCore-&gt;getList - [line 253 - controllers/admin/AdminCategoriesController.php] - [6 Arguments]
  
  248.         return parent::renderList();
  249.     }
  250. 
  251.     public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
  252.     {
  
  **253.         parent::getList($id_lang, $order_by, $order_way, $start, $limit, Context::getContext()-&gt;shop-&gt;id);**
  
  254.         // Check each row to see if there are combinations and get the correct action in consequence
  255. 
  256.         $nb_items = count($this-&gt;_list);
  257.         for ($i = 0; $i &lt; $nb_items; $i++) {
  258.             $item = &amp;$this-&gt;_list[$i];
  </code></pre>
  
  <hr>
  
  <pre><code>AdminCategoriesControllerCore-&gt;getList - [line 2333 - classes/controller/AdminController.php] - [1 Arguments]
  
  Argument [0]
  1
  </code></pre>
  
  <hr>
  
  <pre><code>AdminControllerCore-&gt;renderList - [line 248 - controllers/admin/AdminCategoriesController.php]
  
  243.             $this-&gt;tpl_list_vars['delete_category'] = true;
  244.             $this-&gt;tpl_list_vars['REQUEST_URI'] = $_SERVER['REQUEST_URI'];
  245.             $this-&gt;tpl_list_vars['POST'] = $_POST;
  246.         }
  247. 
  
  **248.         return parent::renderList();**
  
  249.     }
  250. 
  251.     public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
  252.     {
  253.         parent::getList($id_lang, $order_by, $order_way, $start, $limit, Context::getContext()-&gt;shop-&gt;id);
  </code></pre>
  
  <hr>
  
  <pre><code>AdminCategoriesControllerCore-&gt;renderList - [line 2034 - classes/controller/AdminController.php]
  
  2029.         } elseif ($this-&gt;display == 'details') {
  2030.             $this-&gt;content .= $this-&gt;renderDetails();
  2031.         } elseif (!$this-&gt;ajax) {
  2032.             $this-&gt;content .= $this-&gt;renderModulesList();
  2033.             $this-&gt;content .= $this-&gt;renderKpis();
  
  **2034.             $this-&gt;content .= $this-&gt;renderList();**
  
  2035.             $this-&gt;content .= $this-&gt;renderOptions();
  2036. 
  2037.             // if we have to display the required fields form
  2038.             if ($this-&gt;required_database) {
  2039.                 $this-&gt;content .= $this-&gt;displayRequiredFields();
  </code></pre>
  
  <hr>
  
  <pre><code>AdminControllerCore-&gt;initContent - [line 199 - controllers/admin/AdminCategoriesController.php]
  
  194.                 'url_delete' =&gt; htmlentities($_SERVER['REQUEST_URI']),
  195.                 'boxes' =&gt; $this-&gt;boxes,
  196.             ));
  197.         }
  198. 
  
  **199.         parent::initContent();**
  
  200.     }
  201. 
  202.     public function setMedia()
  203.     {
  204.         parent::setMedia();
  </code></pre>
  
  <hr>
  
  <pre><code>AdminCategoriesControllerCore-&gt;initContent - [line 189 - classes/controller/Controller.php]
  
  184.             if (!$this-&gt;content_only &amp;&amp; ($this-&gt;display_header || (isset($this-&gt;className) &amp;&amp; $this-&gt;className))) {
  185.                 $this-&gt;initHeader();
  186.             }
  187. 
  188.             if ($this-&gt;viewAccess()) {
  
  **189.                 $this-&gt;initContent();**
  
  190.             } else {
  191.                 $this-&gt;errors[] = Tools::displayError('Access denied.');
  192.             }
  193. 
  194.             if (!$this-&gt;content_only &amp;&amp; ($this-&gt;display_footer || (isset($this-&gt;className) &amp;&amp; $this-&gt;className))) {
  </code></pre>
  
  <hr>
  
  <pre><code>ControllerCore-&gt;run - [line 367 - classes/Dispatcher.php]
  
  362.             if (isset($params_hook_action_dispatcher)) {
  363.                 Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
  364.             }
  365. 
  366.             // Running controller
  
  **367.             $controller-&gt;run();**
  
  368.         } catch (PrestaShopException $e) {
  369.             $e-&gt;displayMessage();
  370.         }
  371.     }
  372. 
  </code></pre>
  
  <hr>
  
  <pre><code>DispatcherCore-&gt;dispatch - [line 58 - admin/index.php]
  
  53. if (!isset($_REQUEST['controller']) &amp;&amp; isset($_REQUEST['tab'])) {
  54.     $_REQUEST['controller'] = strtolower($_REQUEST['tab']);
  55. }
  56. 
  57. // Prepare and trigger admin dispatcher
  
  
  **58. Dispatcher::getInstance()-&gt;dispatch();**
  </code></pre>
  
  <hr>
  
  <p>Google isn't much help.</p>
  
  <p>Have you seen this before, and how can I (or someone else) fix this?</p>
  
  <p>Thank you for feedback!</p>
  
  <p>p.s. the domain is Giantjeans.com</p>