Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » [BUG?]Like() always case sensitive on MySql
[BUG?]Like() always case sensitive on MySql [message #39707] Fri, 19 April 2013 01:23 Go to next message
Alboni is currently offline  Alboni
Messages: 203
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
The Like() function always generates "like binary" on MySql regardless of whether I specify case sensitive (bool cs) or not.
This looks like a bug to me. I can't think of a reason to ignore the cs parameter on MySql.

SqlBool Like(const SqlVal& a, const SqlVal& b, bool cs) {
	return SqlBool(a, SqlCase
			(MY_SQL, " like binary ")
			(PGSQL, cs ? " like " : " ilike ")
			(" like "),	b, SqlS::COMP);
}


I solved it in my program like this:

SqlBool iLike(const SqlVal& a, const SqlVal& b, bool cs) {
	return SqlBool(a, SqlCase
			(MY_SQL, cs ? " like binary " : " like ")
			(PGSQL, cs ? " like " : " ilike ")
			(" like "),	b, SqlS::COMP);
}



(Release 5485)

[Updated on: Fri, 19 April 2013 15:52]

Report message to a moderator

Re: [BUG?]Like() always case sensitive on MySql [message #39922 is a reply to message #39707] Sat, 11 May 2013 11:30 Go to previous message
mirek is currently offline  mirek
Messages: 13053
Registered: November 2005
Ultimate Member
Patch accepted, thanks.

Mirek
Previous Topic: Sqlite foreign key question
Next Topic: Reason why session does not connect
Goto Forum:
  


Current Time: Sun Jan 24 09:44:40 CET 2021

Total time taken to generate the page: 0.02250 seconds