Relationship Graph

Relationship Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

This bug affects 1 person(s).
 16
IDProjectCategoryView StatusLast Update
06207Bug reportsSurvey editingpublic2012-07-05 22:29
Reporteruser20367Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.92+ 
Fixed in Version1.92+ 
Summary06207: [Microsoft][ODBC SQL Server Driver][SQL Server]Ambiguous column name 'qid'
Description

[Microsoft][ODBC SQL Server Driver][SQL Server]Ambiguous column name 'qid'.:select distinct c., q.sid, q.type from [lime_conditions] as c, [lime_questions] as q where c.qid in (select qid from [lime_questions] where sid = 94154) and c.cqid=q.qid union select c., q.sid, '' as type from [lime_conditions] as c, [lime_questions] as q where c.qid in (select qid from [lime_questions] where sid = 94154) and c.cqid = 0 and c.qid = q.qid order by sid, qid, scenario, cqid, cfieldname, value

Steps To Reproduce

It occours while editting answers options in a question with type "list(radio)"

TagsNo tags attached.
Bug heat16
Complete LimeSurvey version number (& build)120608
I will donate to the project if issue is resolvedNo
BrowserMozilla Firefox 12
Database type & versionMSSQL 2000
Server OS (if known)Windows Server 2003
Webserver software & version (if known)IIS 6
PHP VersionPHP 5.2.6

Relationships

has duplicate 06274 closedc_schmitz When updating I get a [Microsoft][ODBC SQL Server Driver][SQL Server]Ambiguous column name error 

Activities

user20391

2012-06-14 12:35

  ~19250

We had the same issue at our end which also affected the import process. In the end it was simply a one line change in LimeExpressionManager.php:
https://github.com/LimeSurvey/LimeSurvey/blob/f4cb290c850acf871c31903a37f8f6c450908ee0/classes/expressions/LimeExpressionManager.php#L6897

If you change the following line:
." order by sid, qid, scenario, cqid, cfieldname, value";

To:
." order by sid, c.qid, scenario, cqid, cfieldname, value";

This prevents the "qid" column name from being ambiguous.

If you want me to submit this as a patch then let me know.

Hope that helps,
Graeme

c_schmitz

c_schmitz

2012-06-19 12:28

administrator   ~19349

Thank you!

c_schmitz

c_schmitz

2012-06-19 12:36

administrator   ~19354

Fix committed to Yii branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=8781

c_schmitz

c_schmitz

2012-06-19 13:01

administrator   ~19357

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=8787

TMSWhite

TMSWhite

2012-06-19 16:03

reporter   ~19363

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=8792

TMSWhite

TMSWhite

2012-06-19 16:11

reporter   ~19364

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=8793

TMSWhite

TMSWhite

2012-06-19 16:33

reporter   ~19365

Fix committed to Yii branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=8794

c_schmitz

c_schmitz

2012-06-20 14:08

administrator   ~19384

New 1.92+ version released.

c_schmitz

c_schmitz

2012-07-05 22:29

administrator   ~19631

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=8902

Related Changesets

LimeSurvey: master d399fb7e

2012-06-19 03:28:43

c_schmitz

Details Diff
Fixed issue 06207: [Microsoft][ODBC SQL Server Driver][SQL Server]Ambiguous column name 'qid' Affected Issues
06207
mod - classes/expressions/LimeExpressionManager.php Diff File

LimeSurvey: Yii 8ec13f0f

2012-06-19 03:28:49

c_schmitz

Details Diff
Fixed issue 06207: [Microsoft][ODBC SQL Server Driver][SQL Server]Ambiguous column name 'qid' Affected Issues
06207
mod - application/helpers/expressions/em_manager_helper.php Diff File

LimeSurvey: master 781b26ba

2012-06-19 07:03:04

TMSWhite

Details Diff
Fixed issue 06207: [Microsoft][ODBC SQL Server Driver][SQL Server]Ambiguous column name 'qid'
Dev reverted commit d399fb7eb78f2427a26edda6ce4442426949f4a8, since although it may fix MSSQL, it breaks MySql
Affected Issues
06207
mod - classes/expressions/LimeExpressionManager.php Diff File

LimeSurvey: master 165b5e7e

2012-06-19 07:10:51

TMSWhite

Details Diff
Fixed issue 06207: [Microsoft][ODBC SQL Server Driver][SQL Server]Ambiguous column name 'qid'
Dev now properly handles different SQL syntax between MSSQL and others
Affected Issues
06207
mod - classes/expressions/LimeExpressionManager.php Diff File

LimeSurvey: Yii ca448238

2012-06-19 07:33:18

TMSWhite

Details Diff
Fixed issue 06207: [Microsoft][ODBC SQL Server Driver][SQL Server]Ambiguous column name 'qid'
Dev now properly handles different SQL syntax between MSSQL and others
Affected Issues
06207
mod - application/helpers/expressions/em_manager_helper.php Diff File

LimeSurvey: master bd59bd74

2012-07-05 13:29:05

c_schmitz

Details Diff
Fixed issue 06207: Error "Ambiguous column name 'qid'" when using MSSQL server and editing answer options Affected Issues
06207
mod - classes/expressions/LimeExpressionManager.php Diff File
mod - common.php Diff File
mod - common_functions.php Diff File
mod - statistics_user.php Diff File

Issue History

Date Modified Username Field Change
2012-06-12 21:54 user20367 New Issue
2012-06-12 22:30 c_schmitz Assigned To => c_schmitz
2012-06-12 22:30 c_schmitz Status new => assigned
2012-06-14 12:35 user20391 Note Added: 19250
2012-06-14 12:36 user20391 Issue Monitored: user20391
2012-06-19 12:28 c_schmitz Note Added: 19349
2012-06-19 12:28 c_schmitz Status assigned => resolved
2012-06-19 12:28 c_schmitz Fixed in Version => 1.92+
2012-06-19 12:28 c_schmitz Resolution open => fixed
2012-06-19 12:36 c_schmitz Changeset attached => LimeSurvey Yii 8ec13f0f
2012-06-19 12:36 c_schmitz Note Added: 19354
2012-06-19 13:01 c_schmitz Changeset attached => LimeSurvey master d399fb7e
2012-06-19 13:01 c_schmitz Note Added: 19357
2012-06-19 16:03 TMSWhite Changeset attached => LimeSurvey master 781b26ba
2012-06-19 16:03 TMSWhite Note Added: 19363
2012-06-19 16:11 TMSWhite Changeset attached => LimeSurvey master 165b5e7e
2012-06-19 16:11 TMSWhite Note Added: 19364
2012-06-19 16:33 TMSWhite Changeset attached => LimeSurvey Yii ca448238
2012-06-19 16:33 TMSWhite Note Added: 19365
2012-06-20 14:08 c_schmitz Note Added: 19384
2012-06-20 14:08 c_schmitz Status resolved => closed
2012-06-26 15:14 Mazi Relationship added has duplicate 06274
2012-07-05 22:29 c_schmitz Changeset attached => LimeSurvey master bd59bd74
2012-07-05 22:29 c_schmitz Note Added: 19631
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing