View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
18550Bug reportsResponse browsingpublic2024-01-19 17:23
ReporterDenisChenu Assigned ToDenisChenu  
PrioritynoneSeverityminor 
Status assignedResolutionreopened 
Product Version3.28.x 
Summary18550: MSSQL Reponse filter with underscore or bracket not working
Description

When have response with underscore (_) or backet like [ or ] : filtering does not give any results.

Steps To Reproduce

Steps to reproduce

Have a MSSQL (and another DB to compare)
Import included survey
Go to browse response
Try filtering TEXT by _
Try filtering TEXT by check[bracket]

Expected result

Have some value in response

Actual result

Empty result

TagsNo tags attached.
Attached Files
Bug heat4
Complete LimeSurvey version number (& build)5.4.14
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionSQLServer (MS) 15.00.4261
Server OS (if known)windows
Webserver software & version (if known)IIS
PHP VersionPHP7.4

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2022-12-12 18:58

developer   ~73068

See Yii 2

https://github.com/yiisoft/yii2/blob/3ad01aa0f04b26313c28811b9e1f052cbb19b6f7/framework/db/mssql/conditions/LikeConditionBuilder.php#L18

Against Yii1

https://github.com/yiisoft/yii/blob/8530c30959d5f68c0d1b0d611e3ce2bf32a8371a/framework/db/schema/CDbCriteria.php#L259

DenisChenu

DenisChenu

2022-12-12 19:02

developer   ~73069

Last edited: 2022-12-12 19:06

Own fix here :
https://gitlab.com/SondagesPro/QuestionSettingsType/SelectQuestionByResponses/-/blob/main/SelectQuestionByResponses.php#L747

http://burnignorance.com/database-tips-and-tricks/how-to-escape-wildcard-characters-while-searching-in-sql-server/
https://www.howtogeek.com/howto/the-geek-blog/search-for-rows-with-special-characters-in-sql-server/

DenisChenu

DenisChenu

2023-01-21 13:48

developer   ~73521

No way to extend CBDCriteria or replace CBDCriteria ???
Arg …

https://github.com/yiisoft/yii/issues/4512

DenisChenu

DenisChenu

2023-05-04 16:34

developer   ~74817

@ollehar : the only way to fix it seems to fix manually Yii1 …

See https://github.com/yiisoft/yii/issues/4512#issuecomment-1400704265

We close as «Not fixable» an i create a Fork for MSSQL ?
Or we apply a fix to Yii1 ?

DenisChenu

DenisChenu

2023-05-04 16:35

developer   ~74818

Last edited: 2023-05-04 16:36

Did i take time to fix it in LimeSurey core
Or i fix it in a fork Shnoulle/LimsurveySQL (more quick … )

ollehar

ollehar

2023-05-05 11:46

administrator   ~74831

Urgh. Not sure.

ollehar

ollehar

2023-05-05 11:47

administrator   ~74832

Last edited: 2023-05-05 11:47

Is this fixed in Yii 3 query builder or active record package, I wonder...

DenisChenu

DenisChenu

2023-05-05 11:50

developer   ~74833

Me too … i think i create a fork for one of my client, updating directly Yii

But : if i do it for LS :

  1. Create a LSCDbCriteria extends CDbCriteria
  2. replace addSearchCondition function : if escape and MSSQL : set escape as false and do own replacement
  3. Call parent
  4. Replace ALL CDbCriteria i found by LSCDbCriteria

Tell me :)

DenisChenu

DenisChenu

2023-05-05 11:51

developer   ~74834

Last edited: 2023-05-05 11:51

Is this fixed in Yii 3 query builder or active record package, I wonder...

Fixed in Yii2, then Yii3 too.

ollehar

ollehar

2023-05-05 12:01

administrator   ~74835

OK, so since master now require PHP 7.4 at least, it's actually possible for us to start to use Yii 3 packages step by step. Dunno if that would work here tho.

DenisChenu

DenisChenu

2023-05-05 15:32

developer   ~74843

OK, so since master now require PHP 7.4 at least, it's actually possible for us to start to use Yii 3 packages step by step. Dunno if that would work here tho.

take a lot more time , i do my fork :)
(and i need a LS3 fork too)

DenisChenu

DenisChenu

2023-07-27 15:29

developer   ~76303

Can be incluided in https://github.com/LimeSurvey/LimeSurvey/blob/master/application/core/LSDbCriteria.php

Issue History

Date Modified Username Field Change
2022-12-12 18:44 DenisChenu New Issue
2022-12-12 18:44 DenisChenu File Added: survey_archive_MSSQL_compare.lsa
2022-12-12 18:44 DenisChenu File Added: MSSQL_bracket.mp4
2022-12-12 18:44 DenisChenu File Added: MSSQL_underscore.mp4
2022-12-12 18:44 DenisChenu Assigned To => DenisChenu
2022-12-12 18:44 DenisChenu Status new => assigned
2022-12-12 18:58 DenisChenu Note Added: 73068
2022-12-12 18:58 DenisChenu Bug heat 0 => 2
2022-12-12 19:02 DenisChenu Note Added: 73069
2022-12-12 19:06 DenisChenu Note Edited: 73069
2023-01-21 13:48 DenisChenu Note Added: 73521
2023-05-04 16:34 DenisChenu Note Added: 74817
2023-05-04 16:35 DenisChenu Assigned To DenisChenu => ollehar
2023-05-04 16:35 DenisChenu Status assigned => feedback
2023-05-04 16:35 DenisChenu Note Added: 74818
2023-05-04 16:36 DenisChenu Note Edited: 74818
2023-05-05 11:46 ollehar Note Added: 74831
2023-05-05 11:46 ollehar Bug heat 2 => 4
2023-05-05 11:47 ollehar Note Added: 74832
2023-05-05 11:47 ollehar Note Edited: 74832
2023-05-05 11:50 DenisChenu Note Added: 74833
2023-05-05 11:50 DenisChenu Status feedback => assigned
2023-05-05 11:51 DenisChenu Note Added: 74834
2023-05-05 11:51 DenisChenu Note Edited: 74834
2023-05-05 12:01 ollehar Note Added: 74835
2023-05-05 15:32 DenisChenu Note Added: 74843
2023-06-16 10:42 c_schmitz Summary MSSQL Reponse filter with underscore or bracket are broken => MSSQL Reponse filter with underscore or bracket not working
2023-06-16 10:42 c_schmitz Description Updated
2023-06-16 10:44 c_schmitz Status assigned => closed
2023-06-16 10:44 c_schmitz Resolution open => won't fix
2023-07-27 15:29 DenisChenu Assigned To ollehar => DenisChenu
2023-07-27 15:29 DenisChenu Status closed => feedback
2023-07-27 15:29 DenisChenu Resolution won't fix => reopened
2023-07-27 15:29 DenisChenu Note Added: 76303
2024-01-19 17:23 DenisChenu Status feedback => assigned
2024-01-19 17:23 DenisChenu Complete LimeSurvey version number (& build) 3.28.42 and 5.4.14 => 5.4.14