U++ framework
Do not panic. Ask here before giving up.

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: 216
Registered: January 2012
Location: Kajaani, Finland
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: 14291
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 May 24 19:42:16 GMT+2 2026

Total time taken to generate the page: 0.00491 seconds