CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'attribute_1'. The SQL statement executed was: ALTER TABLE `lime_tokens_184133` ADD `attribute_1` VARCHAR(255)

/home/sondages.pro/htdocs/limesurvey_GIT/LimeSurvey/framework/db/CDbCommand.php(358)

346         {
347             if($this->_connection->enableProfiling)
348                 Yii::endProfile('system.db.CDbCommand.execute('.$this->getText().$par.')','system.db.CDbCommand.execute');
349 
350             $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
351             $message=$e->getMessage();
352             Yii::log(Yii::t('yii','CDbCommand::execute() failed: {error}. The SQL statement executed was: {sql}.',
353                 array('{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
354 
355             if(YII_DEBUG)
356                 $message.='. The SQL statement executed was: '.$this->getText().$par;
357 
358             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
359                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
360         }
361     }
362 
363     /**
364      * Executes the SQL statement and returns query result.
365      * This method is for executing an SQL query that returns result set.
366      * @param array $params input parameters (name=>value) for the SQL execution. This is an alternative
367      * to {@link bindParam} and {@link bindValue}. If you have multiple input parameters, passing
368      * them in this way can improve the performance. Note that if you pass parameters in this way,
369      * you cannot bind parameters or values using {@link bindParam} or {@link bindValue}, and vice versa.
370      * Please also note that all values are treated as strings in this case, if you need them to be handled as

Stack Trace

#0
+
 /home/sondages.pro/htdocs/limesurvey_GIT/LimeSurvey/application/controllers/admin/tokens.php(1095): CDbCommand->execute()
1090             while (in_array('attribute_' . $i, $tokenattributefieldnames) !== false)
1091             {
1092                 $i++;
1093             }
1094             $tokenattributefieldnames[] = 'attribute_' . $i;
1095             Yii::app()->db->createCommand(Yii::app()->db->getSchema()->addColumn("{{tokens_".intval($iSurveyId)."}}", 'attribute_' . $i, 'VARCHAR(255)'))->execute();
1096             $fields['attribute_' . $i] = array('type' => 'VARCHAR', 'constraint' => '255');
1097         }
1098 
1099         Yii::app()->db->schema->getTable('{{tokens_' . $iSurveyId . '}}', true); // Refresh schema cache just in case the table existed in the past
1100         LimeExpressionManager::SetDirtyFlag();  // so that knows that token tables have changed
#3
+
 /home/sondages.pro/htdocs/limesurvey_GIT/LimeSurvey/application/core/Survey_Common_Action.php(99): CAction->runWithParamsInternal(tokens, ReflectionMethod, array("surveyid" => "184133", "sa" => "updatetokenattributes", "iSurveyId" => "184133", "iSurveyID" => "184133"))
094             $oMethod = new ReflectionMethod($this, $sDefault);
095         }
096 
097         // We're all good to go, let's execute it
098         // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
099         return parent::runWithParamsInternal($this, $oMethod, $params);
100     }
101 
102     /**
103     * Some functions have different parameters, which are just an alias of the
104     * usual parameters we're getting in the url. This function just populates
#7
+
 /home/sondages.pro/htdocs/limesurvey_GIT/LimeSurvey/application/controllers/AdminController.php(169): CController->run("tokens")
164                     $this->redirect(array('/admin/authentication/sa/login'));
165                 }
166                 
167             }
168 
169             return parent::run($action);
170     }
171 
172     /**
173     * Routes all the actions to their respective places
174     *
2014-02-10 10:52:41 Apache/2.2.16 (Debian) Yii Framework/1.1.14