Home » U++ Library support » U++ SQL » PostgreSql does not handle BOOL correctly
Re: PostgreSql does not handle BOOL correctly [BUG+PATCH] [message #60221 is a reply to message #60220] |
Sat, 21 October 2023 01:14   |
omari
Messages: 276 Registered: March 2010
|
Experienced Member |
|
|
This test case (attached) FAIL without the patch, and PASS with the patch.
if(!OpenDB()) return;
Sql sql(session);
sql * Insert(TEST1) (ID, 1) (B, true);
sql * Insert(TEST1) (ID, 2) (B, false);
sql*Select(SqlAll()).From(TEST1).Where(B == true);
LOG(sql.ToString());
if (sql.Fetch()) {
ASSERT(sql[ID] == 1);
}
else {
ASSERT(false); // Failed : 'Select' should return one row
}
sql*Select(SqlAll()).From(TEST1).Where(B == false);
LOG(sql.ToString());
if (sql.Fetch()) {
ASSERT(sql[ID] == 2);
}
else {
ASSERT(false); // Failed : 'Select' should return one row
}
the schema file:
TABLE_(TEST1)
INT_ (ID) PRIMARY_KEY
BOOL_ (B)
END_TABLE
regards
omari.
|
|
|
Goto Forum:
Current Time: Thu Aug 21 16:26:48 CEST 2025
Total time taken to generate the page: 0.05325 seconds
|