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 » How to use Like() with SqlArray
Re: How to use Like() with SqlArray [message #4132 is a reply to message #4131] Mon, 24 July 2006 09:49 Go to previous messageGo to previous message
unodgs is currently offline  unodgs
Messages: 1367
Registered: November 2005
Location: Poland
Ultimate Contributor

zsolt wrote on Mon, 24 July 2006 02:59

Thanks, you are right.
I have changed Like() in Sqlexp.cpp from
SqlBool Like(const SqlVal& a, const SqlVal& b) {
	int sqld = GetSqlDialect(a, b);
	return SqlBool(a, sqld == SQLD_MYSQL || sqld == SQLD_SQLITE3 ? " like binary " : " like ", b, SqlS::COMP);
}

to
SqlBool Like(const SqlVal& a, const SqlVal& b) {
	int sqld = GetSqlDialect(a, b);
	return SqlBool(a, sqld == SQLD_MYSQL ? " like binary " : " like ", b, SqlS::COMP);
}

and now it is working correcly. I have no idea why that "binary" was in sources. I tested "like binary" directly in sqlite and it produces an error. So this was a bug, I think.


From mysql page:

The following two statements illustrate that string comparisons are not case sensitive unless one of the operands is a binary string:
mysql> SELECT 'abc' LIKE 'ABC';
-> 1
mysql> SELECT 'abc' LIKE BINARY 'ABC';
-> 0

http://dev.mysql.com/doc/refman/5.0/en/string-comparison-fun ctions.html

More about binary operator:
http://dev.mysql.com/doc/refman/5.1/en/charset-binary-op.htm l
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: sqlite3 compile problems on fresh install
Next Topic: sqlite3 plugin documentation
Goto Forum:
  


Current Time: Tue Aug 12 03:42:06 CEST 2025

Total time taken to generate the page: 0.00655 seconds