bugGNUstep - Bugs: bug #19503, ...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #19503: PostgreSQLChannel.m/newValueForDateTypeLengthAttribute milliseconds problem

Submitted by:  Manuel Guesdon <mguesdon>
Submitted on:  Tue 03 Apr 2007 07:24:12 PM UTC  
 
Category:  gdl2 Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  David Ayers <ayers>
Open/Closed:  Closed

Mon 16 Apr 2007 07:34:16 AM UTC, comment #1:

Thanks... I the millisecond value was replacing the second value and wasn't set itself. Fixed in SVN.
I'm still a but surprised that the compiler doesn't optimize:
if (localuint > 2)
{ /*don't alter localuint */ }
if (localuint > 5)
{ /*don't alter localuint */ }
if (localuint > 9)
{ /*don't alter localuint */ }

to:
if (localuint > 2)
{ /*don't alter localuint */
if (localuint > 5)
{ /*don't alter localuint */
if (localuint > 9)
{ /*don't alter localuint */ }
}
}

by itself but I'm not finding the time to investigate so changed it as you suggested (but didn't update the indetation yet as I may still look into this later.

David Ayers <ayers>
Project MemberIn charge of this item.
Tue 03 Apr 2007 07:24:12 PM UTC, original submission:

In PostgreSQLAdaptor/PostgreSQLChannel.m:

newValueForDateTypeLengthAttribute (const void *bytes,
int length,
EOAttribute *attribute,
NSStringEncoding encoding)

There's 2 timeslength >18 case and milliseconds are not handled
....
if (length > 18)
{
char tmpString[3];
getDigits(&str[17],tmpString,2,&error);
second = atoi(tmpString);
}

if (length > 18)
{
char tmpString[3];
getDigits(&str[17],tmpString,2,&error);
second = atoi(tmpString);
}
...

BTW, won't it be better to have:
if (length > 3)
{
char tmpString[5];
getDigits(&str[0],tmpString,4,&error);
year = atoi(tmpString);
if (length > 6)
{
char tmpString[3];
getDigits(&str[5],tmpString,2,&error);
month = atoi(tmpString);
if (...)

Manuel Guesdon <mguesdon>
Project Member

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ayers (Posted a comment)
  • -email is unavailable- added by mguesdon (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-04-16 ayers StatusNone => Fixed
        Open/ClosedOpen => Closed

    Back to the top


    Powered by Savane 3.4