everycook/EveryCook

Shopping list bug

everycook opened this issue · 1 comments

Trace is:

CDbException

CDbCommand konnte das SQL-Statement nicht ausführen: SQLSTATE[HY000]: General error: 1548 Cannot load from mysql.proc. The table is probably corrupted. The SQL statement executed was: SELECT
theView.PRO_ID,
MAX(min_dist) as min_dist,
MAX(dist) as dist,
SUM(amount) as amount,
SUM(amount_range) as amount_range
FROM (
(SELECT
@count := 0,
@OlDid := 0 AS PRO_ID,
0 AS min_dist,
0 AS dist,
0 AS amount,
0 As amount_range)
UNION
(SELECT
@count := if(@OlDid = id, @count+1, 0),
@OlDid := id,
if(@count = 0, value, 0),
if(@count < 5, value, 0),
if(@count < 5, 1, 0),
if(value < 5, 1, 0)
FROM
(SELECT products.PRO_ID as id, cosines_distance(stores.STO_GPS_POINT, GeomFromText('POINT(47.5084280798357 8.76793548205717)')) as value
FROM products
LEFT JOIN pro_to_sto ON pro_to_sto.PRO_ID=products.PRO_ID
LEFT JOIN stores ON pro_to_sto.SUP_ID=stores.SUP_ID AND pro_to_sto.STY_ID=stores.STY_ID
WHERE stores.STO_GPS_POINT IS NOT NULL
ORDER BY products.PRO_ID, value ASC) AS theTable
)
) AS theView
WHERE theView.PRO_ID != 0 AND (dist != 0 OR amount_range != 0)
GROUP BY theView.PRO_ID;

/var/www/db_2014_12_28/lib/yii/framework/db/CDbCommand.php(543)

531 {
532 if($this->_connection->enableProfiling)
533 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
534
535 $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
536 $message=$e->getMessage();
537 Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
538 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
539
540 if(YII_DEBUG)
541 $message.='. The SQL statement executed was: '.$this->getText().$par;
542
543 throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
544 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
545 }
546 }
547
548 /**
549 * Builds a SQL SELECT statement from the given query specification.
550 * @param array $query the query specification in name-value pairs. The following
551 * query options are supported: {@link select}, {@link distinct}, {@link from},
552 * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
553 * {@link limit}, {@link offset} and {@link union}.
554 * @throws CDbException if "from" key is not present in given query parameter
555 * @return string the SQL statement
Stack Trace
#0

  • /var/www/db_2014_12_28/lib/yii/framework/db/CDbCommand.php(396): CDbCommand->queryInternal("fetchAll", array(2), array())
    #1
    – /var/www/db_2014_12_28/protected/controllers/ShoppinglistsController.php(335): CDbCommand->queryAll()
    330 foreach ($youDistRows as $row){
    331 $youDistArray[$row['PRO_ID']] = array($row['dist'], $row['amount'], $row['min_dist'], $row['amount_range']);
    332 }
    333 }
    334 if ($hasHomeDist){
    335 $homeDistRows = $HomeDistCommand->queryAll();
    336 $homeDistArray = array();
    337 foreach ($homeDistRows as $row){
    338 $homeDistArray[$row['PRO_ID']] = array($row['dist'], $row['amount'], $row['min_dist'], $row['amount_range']);
    339 }
    340 }
    #2
    – /var/www/db_2014_12_28/protected/controllers/ShoppinglistsController.php(167): ShoppinglistsController->viewList(array("108", "33"), array("255.63", "232.39"), array("", ""), array("", ""), ...)
    162 } else {
    163 $MEA_ID = $meal['MEA_ID'];
    164 $changed = (isset($meal['CHANGED_ON']) && $meal['CHANGED_ON'] > $model->CHANGED_ON);
    165 }
    166
    167 $this->viewList($ing_ids, $ing_weights, $pro_ids, $gramm_values, $model->SHO_ID, $MEA_ID, $changed);
    168 }
    169
    170
    171 public function actionShowAllAsOne() {
    172 $shoppinglists = Yii::app()->user->shoppinglists;
    #3
    unknown(0): ShoppinglistsController->actionView("48")
    #4
  • /var/www/db_2014_12_28/lib/yii/framework/web/actions/CAction.php(108): ReflectionMethod->invokeArgs(ShoppinglistsController, array("48"))
    #5
  • /var/www/db_2014_12_28/lib/yii/framework/web/actions/CInlineAction.php(47): CAction->runWithParamsInternal(ShoppinglistsController, ReflectionMethod, array("id" => "48"))
    #6
  • /var/www/db_2014_12_28/lib/yii/framework/web/CController.php(308): CInlineAction->runWithParams(array("id" => "48"))
    #7
  • /var/www/db_2014_12_28/lib/yii/framework/web/filters/CFilterChain.php(133): CController->runAction(CInlineAction)
    #8
  • /var/www/db_2014_12_28/lib/yii/framework/web/filters/CFilter.php(40): CFilterChain->run()
    #9
  • /var/www/db_2014_12_28/lib/yii/framework/web/CController.php(1145): CFilter->filter(CFilterChain)
    #10
  • /var/www/db_2014_12_28/lib/yii/framework/web/filters/CInlineFilter.php(58): CController->filterAccessControl(CFilterChain)
    #11
  • /var/www/db_2014_12_28/lib/yii/framework/web/filters/CFilterChain.php(130): CInlineFilter->filter(CFilterChain)
    #12
  • /var/www/db_2014_12_28/lib/yii/framework/web/CController.php(291): CFilterChain->run()
    #13
  • /var/www/db_2014_12_28/lib/yii/framework/web/CController.php(265): CController->runActionWithFilters(CInlineAction, array("accessControl"))
    #14
  • /var/www/db_2014_12_28/lib/yii/framework/web/CWebApplication.php(282): CController->run("view")
    #15
  • /var/www/db_2014_12_28/lib/yii/framework/web/CWebApplication.php(141): CWebApplication->runController("shoppinglists/view")
    #16
  • /var/www/db_2014_12_28/lib/yii/framework/base/CApplication.php(180): CWebApplication->processRequest()
    #17
    – /var/www/db_2014_12_28/index.php(13): CApplication->run()
    08 defined('YII_DEBUG') or define('YII_DEBUG',true);
    09 // specify how many levels of call stack should be shown in each log message
    10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
    11
    12 require_once($yii);
    13 Yii::createWebApplication($config)->run();

this logic is completely changed in Testsystem, and will not occur any more after bring it to production.