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 previous message
Alboni is currently offline  Alboni
Messages: 214
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

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


Current Time: Thu Mar 28 19:32:10 CET 2024

Total time taken to generate the page: 0.01446 seconds