mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-02 16:22:40 -06:00
*Sql: Fixed operator||(SqlBool, SqlBool) if either of operands is empty or true
git-svn-id: svn://ultimatepp.org/upp/trunk@2343 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
86b56887e2
commit
7ccf33dc1b
1 changed files with 4 additions and 4 deletions
|
|
@ -50,9 +50,9 @@ SqlBool operator!=(const SqlVal& a, const SqlVal& b) {
|
|||
}
|
||||
|
||||
SqlBool operator&&(const SqlBool& a, const SqlBool& b) {
|
||||
if(a.IsFalse() || b.IsFalse()) return false;
|
||||
if(a.IsEmpty() || a.IsTrue()) return b;
|
||||
if(b.IsEmpty() || b.IsTrue()) return a;
|
||||
if(a.IsFalse() || b.IsFalse()) return false;
|
||||
return SqlBool(a, " and ", b, SqlS::LAND);
|
||||
}
|
||||
|
||||
|
|
@ -63,9 +63,9 @@ SqlBool operator- (const SqlBool& a, const SqlBool& b) {
|
|||
}
|
||||
|
||||
SqlBool operator||(const SqlBool& a, const SqlBool& b) {
|
||||
if(a.IsEmpty() || a.IsFalse()) return b;
|
||||
if(b.IsEmpty() || b.IsFalse()) return a;
|
||||
if(a.IsTrue() || b.IsTrue()) return true;
|
||||
if(a.IsTrue() || a.IsEmpty() || b.IsTrue() || b.IsEmpty()) return true;
|
||||
if(a.IsFalse()) return b;
|
||||
if(b.IsFalse()) return a;
|
||||
return SqlBool(a, " or ", b, SqlS::LOR);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue