View Issue Details

This bug affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
04535Bug reportsSurvey takingpublic2010-08-17 13:28
Reporteruser1329Assigned Toc_schmitz  
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
Product Version1.90+ 
Fixed in Version1.90+ 
Summary04535: SQL statement error
Description

[Microsoft][ODBC SQL Server Driver][SQL Server]The data types text and varchar are incompatible in the equal to operator.:SELECT qid,attribute FROM [lime_question_attributes] WHERE value='eng 44'

Steps To Reproduce

Normally, such an error will reproduce while running lime survey on SQL server

Additional Information

Indeed, the statement is from SQL server 2005 incorrect :
the value field has a type 'text' in the DB. In SQL server, the equal operator does not work with types 'text' on SQL server.

Replacing line 3195 in qanda.php
$qaquery = "SELECT qid,attribute FROM ".db_table_name('question_attributes')." WHERE value='".strtolower($ia[2])."'";

by

$qaquery = "SELECT qid,attribute FROM ".db_table_name('question_attributes')." WHERE value LIKE '".strtolower($ia[2])."'";

will make it work.

TagsNo tags attached.
Bug heat2
Complete LimeSurvey version number (& build)9046
I will donate to the project if issue is resolved
Browser
Database type & versionSQL server 2005
Server OS (if known)Windows server 2003
Webserver software & version (if known)IIS6
PHP Version5.2.14

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2010-08-17 12:20

administrator   ~12645

Last edited: 2010-08-17 12:20

Thank you! Fixed in rev 9068

Issue History

Date Modified Username Field Change
2010-08-16 15:02 user1329 New Issue
2010-08-17 01:58 c_schmitz Assigned To => c_schmitz
2010-08-17 01:58 c_schmitz Status new => assigned
2010-08-17 12:20 c_schmitz Note Added: 12645
2010-08-17 12:20 c_schmitz Status assigned => resolved
2010-08-17 12:20 c_schmitz Fixed in Version => 1.90+
2010-08-17 12:20 c_schmitz Resolution open => fixed
2010-08-17 12:20 c_schmitz Note Edited: 12645
2010-08-17 13:28 c_schmitz Status resolved => closed
2010-10-25 00:18 c_schmitz Category Survey at Runtime => Survey taking