Home » U++ Library support » U++ SQL » Postgresql and bool
Postgresql and bool [message #22938] |
Mon, 31 August 2009 09:59 |
Zbych
Messages: 325 Registered: July 2009
|
Senior Member |
|
|
Hi,
In revision 1531 of upp, returned value in PostgreSQLConnection::GetColumn was changed from bool to string:
void PostgreSQLConnection::GetColumn(int i, Ref f) const
[...]
1530:
case BOOL_V:
f.SetValue(*s == 't' ? true : false);
1531:
case BOOL_V:
f.SetValue(*s == 't' ? "1" : "0");
So now when I want to check if returned value is true, an assert is triggered.
sql * Select(ROLCREATEROLE).From(PG_ROLES).Where(ROLNAME == current_user);
if (sql.Fetch()){
if (sql[ROLCREATEROLE]){// <-- ASSERT
[...]
}
}
Correct me if I am wrong, but this change should be done in PostgreSQLConnection::SetParam, because postgres expects '0' and '1' instead of 0 and 1 in case of boolean values.
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Mar 29 12:26:19 CET 2024
Total time taken to generate the page: 0.01694 seconds
|