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 » underflow in bool Sql::fetch()
underflow in bool Sql::fetch() [message #17051] Sat, 26 July 2008 19:15 Go to previous message
grc3H0219 is currently offline  grc3H0219
Messages: 2
Registered: April 2008
Location: michigan
Junior Member
Hello:
I have been Ultimate++ with sqlite3 for about 4 months and have
found Ultimate++ very easy to use. I am using TheIDE 2008.2
beta 2008-03-24 9:41, Mingw and Windows XP Professional SP2. I have run into a few very minor problems.
The first problem is with bool Sql::fetch() and was mentioned in message #14083.
( http://www.ultimatepp.org/forum/index.php?t=msg&goto=140 91& )
The patch corrected the integer overflow of the positive values.
I am seeing integer overflow(underflow) in negative values such that when t is small compared to starttime and traceslow,
- session.traceslow - cn->starttime
is smaller than -(INT_MAX) and is converted to a large postive number instead the small negative value that it is. This results in the output of all SQL statements to the BugLog file. In bool Sql::Fetch(),

When I convert the
bool Sql::fetch() code: if(t - session.traceslow - cn->starttime > 0)

to: if((float)t - (float)session.traceslow - (float)cn->starttime > 0)

or to: if((signed long long)t - (signed long long)session.traceslow - (signed long long)cn->starttime > 0)

the correct number is generated. The following values are typical numbers
for t,starttime and traceslow on my system:

t: 2076696 starttime: 2147483647 traceslow: 536870911

In SqlSession::SqlSession(),
traceslow = INT_MAX / 4; So, if t is less than INT_MAX / 4, there
will be an integer overflow error.

dw
 
Read Message
Read Message
Read Message
Previous Topic: SQLite crashes
Next Topic: FireBird plugin and test program
Goto Forum:
  


Current Time: Mon May 13 01:07:29 CEST 2024

Total time taken to generate the page: 0.03624 seconds