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 » Postgresql and bool
Postgresql and bool [message #22938] Mon, 31 August 2009 09:59 Go to previous message
Zbych is currently offline  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.

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Postgresql - execpt vs minus
Next Topic: Postgres library improvements
Goto Forum:
  


Current Time: Mon Apr 29 05:05:07 CEST 2024

Total time taken to generate the page: 0.47660 seconds