{"action":"closed","issue":{"url":"https://api.github.com/repos/mapserver/mapserver/issues/4130","labels_url":"https://api.github.com/repos/mapserver/mapserver/issues/4130/labels{/name}","comments_url":"https://api.github.com/repos/mapserver/mapserver/issues/4130/comments","events_url":"https://api.github.com/repos/mapserver/mapserver/issues/4130/events","html_url":"https://github.com/mapserver/mapserver/issues/4130","id":3963222,"number":4130,"title":"Postgis like/ilike comparison with integer field","user":{"login":"mapserver-bot","id":1608057,"avatar_url":"https://avatars.githubusercontent.com/u/1608057?v=3","gravatar_id":"","url":"https://api.github.com/users/mapserver-bot","html_url":"https://github.com/mapserver-bot","followers_url":"https://api.github.com/users/mapserver-bot/followers","following_url":"https://api.github.com/users/mapserver-bot/following{/other_user}","gists_url":"https://api.github.com/users/mapserver-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/mapserver-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapserver-bot/subscriptions","organizations_url":"https://api.github.com/users/mapserver-bot/orgs","repos_url":"https://api.github.com/users/mapserver-bot/repos","events_url":"https://api.github.com/users/mapserver-bot/events{/privacy}","received_events_url":"https://api.github.com/users/mapserver-bot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mapserver/mapserver/labels/Bug","name":"Bug","color":"fc2929"},{"url":"https://api.github.com/repos/mapserver/mapserver/labels/MapServer%20C%20Library","name":"MapServer C Library","color":"ffffff"},{"url":"https://api.github.com/repos/mapserver/mapserver/labels/version-master","name":"version-master","color":"ffffff"}],"state":"closed","locked":false,"assignee":{"login":"aboudreault","id":532356,"avatar_url":"https://avatars.githubusercontent.com/u/532356?v=3","gravatar_id":"","url":"https://api.github.com/users/aboudreault","html_url":"https://github.com/aboudreault","followers_url":"https://api.github.com/users/aboudreault/followers","following_url":"https://api.github.com/users/aboudreault/following{/other_user}","gists_url":"https://api.github.com/users/aboudreault/gists{/gist_id}","starred_url":"https://api.github.com/users/aboudreault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aboudreault/subscriptions","organizations_url":"https://api.github.com/users/aboudreault/orgs","repos_url":"https://api.github.com/users/aboudreault/repos","events_url":"https://api.github.com/users/aboudreault/events{/privacy}","received_events_url":"https://api.github.com/users/aboudreault/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2012-04-04T00:28:33Z","updated_at":"2015-11-08T21:25:47Z","closed_at":"2015-11-08T21:25:47Z","body":"**Reporter: aboudreault**\n**Date: 2011/12/20 - 15:46**\n**Trac URL:** http://trac.osgeo.org/mapserver/ticket/4130\nA client has the need to use a WFS filter with a like comparison and an integer field. Checking the mapogcfilter.c code and I see that an easy fix could be done: cast all fields to string when like is used. In the function FLTGetIsLikeComparisonSQLExpression(), we would replace:\r\n\n```\r\nif (bCaseInsensitive == 1 && lp->connectiontype == MS_POSTGIS)\r\n      strlcat(szBuffer, \" ilike '\", bufferSize);\r\n    else\r\n      strlcat(szBuffer, \" like '\", bufferSize);\r\n```\n\r\n\r\nby\r\n\n```\r\nconst char *like_stmt = lp->connectiontype == MS_POSTGIS ? \"::text like '\" : \" like '\";\r\nif (bCaseInsensitive == 1 && lp->connectiontype == MS_POSTGIS)\r\n      strlcat(szBuffer, \"::text ilike '\", bufferSize);\r\n    else\r\n      strlcat(szBuffer, like_stmt, bufferSize);\r\n```\n\r\n\r\nPaul, do you see any issue about that?"}}