CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: [Microsoft][SQL Server Native Client 11.0][SQL Server]The data type text cannot be used as an operand to the UNION, INTERSECT or EXCEPT operators because it is not comparable. . The SQL statement executed was: SELECT * from users where uid in (
SELECT uid from user_in_groups where ugid in (
SELECT ugid from user_in_groups where uid=3
)
)
UNION
SELECT * from users v where v.parent_id=3

C:\limesurvey\framework\db\CDbCommand.php(528)

516             return $result;
517         }
518         catch(Exception $e)
519         {
520             if($this->_connection->enableProfiling)
521                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
522             $errorInfo = $e instanceof PDOException ? $e->errorInfo : null;
523             $message = $e->getMessage();
524             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
525                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
526             if(YII_DEBUG)
527                 $message .= '. The SQL statement executed was: '.$this->getText().$par;
528             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
529                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
530         }
531     }
532 
533     /**
534      * Builds a SQL SELECT statement from the given query specification.
535      * @param array $query the query specification in name-value pairs. The following
536      * query options are supported: {@link select}, {@link distinct}, {@link from},
537      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
538      * {@link limit}, {@link offset} and {@link union}.
539      * @return string the SQL statement
540      * @since 1.1.6

Stack Trace

#1
+
 C:\limesurvey\application\helpers\common_helper.php(1342): CDbCommand->query()
1337     else
1338     {
1339         $uquery = "SELECT * FROM {{users}} ORDER BY uid";
1340     }
1341 
1342     $uresult = Yii::app()->db->createCommand($uquery)->query()->readAll(); //Checked
1343 
1344     if (count($uresult)==0)
1345     //user is not in a group and usercontrolSameGroupPolicy is activated - at least show his own userinfo
1346     {
1347         $uquery = "SELECT u.* FROM {{users}} AS u WHERE u.uid=".$myuid;
#2
+
 C:\limesurvey\application\controllers\admin\useraction.php(43): getUserList()
38     public function index()
39     {
40         $this->getController()->_js_admin_includes(Yii::app()->getConfig('generalscripts') . 'jquery/jquery.tablesorter.min.js');
41         $this->getController()->_js_admin_includes(Yii::app()->getConfig('adminscripts').'users.js');
42 
43         $userlist = getUserList();
44         $usrhimself = $userlist[0];
45         unset($userlist[0]);
46 
47         if (Yii::app()->session['USER_RIGHT_SUPERADMIN'] == 1) {
48             $noofsurveys = Survey::model()->countByAttributes(array("owner_id" => $usrhimself['uid']));
#5
+
 C:\limesurvey\application\core\Survey_Common_Action.php(82): CAction->runWithParamsInternal(UserAction, ReflectionMethod, array("sa" => "index"))
77             $oMethod = new ReflectionMethod($this, $sDefault);
78         }
79 
80         // We're all good to go, let's execute it
81         // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
82         return parent::runWithParamsInternal($this, $oMethod, $params);
83     }
84 
85     /**
86     * Some functions have different parameters, which are just an alias of the
87     * usual parameters we're getting in the url. This function just populates
2012-11-22 10:19:20 Microsoft-IIS/7.5 Yii Framework/1.1.10