View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
07610Bug reportsAuthenticationpublic2017-01-18 15:28
Reporterjoop Assigned Toc_schmitz  
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Fixed in Version2.00+ 
Summary07610: Missing MSSQL support under Linux
Description

LimeSurvey 2.0 does not support other drivers than pdo_mysql, pdo_mysqli, Postgres (pdo_pgsql), MSSQL (pdo_sqlsrv). As pdo_sqlsrv is only supported under Windows, currently MS SQL server is not supported under Linux.

Additional Information

A possible solution: Support for pdo_dblib or pdo_odbc drivers
When pdo_dblib or pdo_odbc drivers are supported, MS SQL server can be used under Linux.

Tagsdatabase driver, mssql, pdo_dblib
Bug heat6
Complete LimeSurvey version number (& build)
I will donate to the project if issue is resolved
Browser
Database type & version
Server OS (if known)
Webserver software & version (if known)
PHP Version

Users monitoring this issue

ChacoKevy

Activities

joop

joop

2013-08-12 16:30

reporter   ~25986

I reviewed the LimeSurvey code about the database driver implementation; Actually the used framework already supports the pdo_dblib driver. The adaptations that should be made for pdo_dblib to work are already made for pdo_sqlsrv and require only a small extension for these statements. As proof-of-principle I adapted Limesurvey 2.00 plus (build 130611) to work with pdo_dblib. Adapted files are uploaded in a ZIP-file. The adapted lines are recognizable by comments “// ADAPTED JV”. In my adaptations I assume DBLIB is always used to connect a MS SQL-server database, though the driver can theoretically support other databases. I used DBLIB in combination with the FreeTDS driver.

Hope this helps to get pdp_dblib supported in the next LimeSurvey versions.

Furthermore I saw that not always proper SQL coding is used in the create statements specific for MS SQL-server; sometimes no “NULL” is used in the column specification. Data type “TEXT” is deprecated since SQL server 2005. Adapted files are also attached in the same ZIP.

joop

joop

2013-08-15 18:36

reporter   ~25999

I actually also tried getting LimeSurvey to work with pdo_odbc. The Yii framework doesn't support pdo_odbc by default. As you adapt Yii to use MssqlSchema for odbc driver, you still have the problem that pdo_odbc doesn't function with parameter binding, which makes it useless for LimeSurvey.

c_schmitz

c_schmitz

2013-09-23 14:22

administrator   ~26331

@joop: Thank you for your effort. I completely overlooked the attached patch, so sorry! I will check it and let you know.

c_schmitz

c_schmitz

2013-09-24 15:00

administrator   ~26354

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

c_schmitz

c_schmitz

2013-09-25 17:21

administrator   ~26366

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

c_schmitz

c_schmitz

2013-09-25 17:26

administrator   ~26367

joop, thank you. I did a few minor changes but in general your patch helped a great deal. This will be available in the next 2.0+ build.

c_schmitz

c_schmitz

2013-09-25 17:52

administrator   ~26368

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

c_schmitz

c_schmitz

2013-10-09 11:22

administrator   ~26670

2.00+ Build 121009 released

joop

joop

2013-10-16 19:17

reporter   ~26825

There is still a small bug in InstallerController.php at line 297. The installation will not work if you have an empty database, while using dblib.
The assumption that $this->connection->createCommand()->select()->from('{{surveys}}')->queryAll(); will throw an error is not true with MSSQL. It will just return an empty result set, so the catch is never reached and bTablesDoNotExist will not be set to true (and no tables will be populated).
I think using a row count query like I used in my patch will solve the problem.

c_schmitz

c_schmitz

2013-10-21 16:11

administrator   ~26878

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

c_schmitz

c_schmitz

2013-10-21 16:11

administrator   ~26879

Thank you for the hint!

c_schmitz

c_schmitz

2013-10-21 16:12

administrator   ~26880

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

c_schmitz

c_schmitz

2013-10-22 15:33

administrator   ~26908

Version 2.00+ Build 131022 released.

Related Changesets

LimeSurvey: master 58520989

2013-09-24 12:59:14

c_schmitz

Details Diff
Fixed issue 07610: Missing MSSQL support under Linux (pdo_dblib support)
Dev Note: Not completed yet
Affected Issues
07610
mod - application/commands/InstallCommand.php Diff File
add - application/config/config-sample-dblib.php Diff File
mod - application/controllers/InstallerController.php Diff File
mod - application/controllers/Statistics_userController.php Diff File
mod - application/helpers/admin/statistics_helper.php Diff File
mod - application/helpers/common_helper.php Diff File
mod - application/helpers/database_helper.php Diff File
mod - application/helpers/export_helper.php Diff File
mod - application/helpers/expressions/em_manager_helper.php Diff File
mod - application/helpers/frontend_helper.php Diff File
mod - application/helpers/update/updatedb_helper.php Diff File
mod - application/models/InstallerConfigForm.php Diff File
mod - application/models/Participants.php Diff File
mod - application/views/admin/survey/surveySummary_view.php Diff File

LimeSurvey: master 9abc3845

2013-09-25 15:20:49

c_schmitz

Details Diff
Fixed issue 07610: Missing MSSQL support under Linux (pdo_dblib support)
Dev Part 2 - should be fully working now
Affected Issues
07610
mod - application/helpers/admin/activate_helper.php Diff File
mod - application/helpers/database_helper.php Diff File
mod - installer/sql/create-mssql.sql Diff File

LimeSurvey: 2.05 9fba97a8

2013-09-25 15:40:00

c_schmitz

Details Diff
Fixed issue 07610: Missing MSSQL support under Linux (pdo_dblib support)
Dev Part 2 - should be fully working now
Affected Issues
07610
mod - application/commands/InstallCommand.php Diff File
add - application/config/config-sample-dblib.php Diff File
mod - application/controllers/InstallerController.php Diff File
mod - application/controllers/Statistics_userController.php Diff File
mod - application/helpers/admin/activate_helper.php Diff File
mod - application/helpers/admin/statistics_helper.php Diff File
mod - application/helpers/common_helper.php Diff File
mod - application/helpers/database_helper.php Diff File
mod - application/helpers/export_helper.php Diff File
mod - application/helpers/expressions/em_manager_helper.php Diff File
mod - application/helpers/frontend_helper.php Diff File
mod - application/helpers/update/updatedb_helper.php Diff File
mod - application/models/InstallerConfigForm.php Diff File
mod - application/models/Participant.php Diff File
mod - application/views/admin/survey/surveySummary_view.php Diff File
mod - installer/sql/create-mssql.sql Diff File

LimeSurvey: master 33e8418f

2013-10-21 14:11:11

c_schmitz

Details Diff
Fixed issue 07610: Failing check for existing database with DBLIB driver Affected Issues
07610
mod - application/controllers/InstallerController.php Diff File

LimeSurvey: 2.05 187bdc3e

2013-10-21 14:11:11

c_schmitz

Details Diff
Fixed issue 07610: Failing check for existing database with DBLIB driver Affected Issues
07610
mod - application/controllers/InstallerController.php Diff File

Issue History

Date Modified Username Field Change
2013-08-12 14:52 joop Tag Attached: database driver
2013-08-12 14:52 joop Tag Attached: linux
2013-08-12 14:52 joop Tag Attached: mssql
2013-08-12 14:52 joop Tag Attached: pdo_dblib
2013-08-12 16:30 joop Note Added: 25986
2013-08-12 16:31 joop File Added: pdodblib support - 2.00 plus build 130611.zip
2013-08-15 18:36 joop Note Added: 25999
2013-09-23 14:21 c_schmitz Assigned To => c_schmitz
2013-09-23 14:21 c_schmitz Status acknowledged => assigned
2013-09-23 14:22 c_schmitz Note Added: 26331
2013-09-23 14:31 c_schmitz Project Feature requests => Development
2013-09-23 14:48 c_schmitz Summary MS SQL support under Linux => Missing MSSQL support under Linux
2013-09-23 14:48 c_schmitz Additional Information Updated
2013-09-23 14:48 c_schmitz Project Development => Bug reports
2013-09-24 15:00 c_schmitz Changeset attached => LimeSurvey master 58520989
2013-09-24 15:00 c_schmitz Note Added: 26354
2013-09-24 15:00 c_schmitz Resolution open => fixed
2013-09-25 17:21 c_schmitz Changeset attached => LimeSurvey master 9abc3845
2013-09-25 17:21 c_schmitz Note Added: 26366
2013-09-25 17:24 c_schmitz Issue Monitored: ChacoKevy
2013-09-25 17:25 c_schmitz File Deleted: pdodblib support - 2.00 plus build 130611.zip
2013-09-25 17:26 c_schmitz Note Added: 26367
2013-09-25 17:26 c_schmitz Status assigned => resolved
2013-09-25 17:26 c_schmitz Fixed in Version => 2.00+
2013-09-25 17:52 c_schmitz Changeset attached => LimeSurvey 2.05 9fba97a8
2013-09-25 17:52 c_schmitz Note Added: 26368
2013-10-09 11:22 c_schmitz Note Added: 26670
2013-10-09 11:22 c_schmitz Status resolved => closed
2013-10-16 19:17 joop Note Added: 26825
2013-10-16 19:17 joop Status closed => feedback
2013-10-16 19:17 joop Resolution fixed => reopened
2013-10-21 16:11 c_schmitz Changeset attached => LimeSurvey master 33e8418f
2013-10-21 16:11 c_schmitz Note Added: 26878
2013-10-21 16:11 c_schmitz Note Added: 26879
2013-10-21 16:11 c_schmitz Status feedback => resolved
2013-10-21 16:11 c_schmitz Resolution reopened => fixed
2013-10-21 16:12 c_schmitz Changeset attached => LimeSurvey 2.05 187bdc3e
2013-10-21 16:12 c_schmitz Note Added: 26880
2013-10-22 15:33 c_schmitz Note Added: 26908
2013-10-22 15:33 c_schmitz Status resolved => closed
2017-01-18 15:28 DenisChenu Tag Detached: linux
2021-08-02 17:19 guest Bug heat 4 => 6