|
|
Home » U++ Library support » U++ SQL » Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
Huge error of Postgresql! Double fields by transmission to the program lose a fractional part! [message #47491] |
Mon, 23 January 2017 02:28 |
|
Huge error of Postgresql!
Double fields by transmission to the program from sql table lose a fractional part!
The decision is extremely simple. To scan a string not as int (atoi), but as Double (ScanDouble).
The request to correct quickly as soon as it is possible!
Place to correct:
file PostgreSQL.cpp
Fucntion: void PostgreSQLConnection::GetColumn(int i, Ref f) const
Line: 644
Now:
switch(info[i].type)
{
case INT64_V:
f.SetValue(ScanInt64(s));
break;
case INT_V:
f.SetValue(atoi(s));
break;
case DOUBLE_V:
f.SetValue(atoi(s)); //<========THIS LINE NEED TO CORRECT
break;
case BOOL_V:
f.SetValue(*s == 't' ? "1" : "0");
break;
case DATE_V:
f.SetValue(sDate(s));
break;
case TIME_V: {
Time t = ToTime(sDate(s));
t.hour = atoi(s + 11);
t.minute = atoi(s + 14);
t.second = atoi(s + 17);
f.SetValue(t);
}
break;
default: {
. . . . .
Must be:
switch(info[i].type)
{
case INT64_V:
f.SetValue(ScanInt64(s));
break;
case INT_V:
f.SetValue(atoi(s));
break;
case DOUBLE_V:
f.SetValue(ScanDouble(s));
break;
case BOOL_V:
f.SetValue(*s == 't' ? "1" : "0");
break;
case DATE_V:
f.SetValue(sDate(s));
break;
case TIME_V: {
Time t = ToTime(sDate(s));
t.hour = atoi(s + 11);
t.minute = atoi(s + 14);
t.second = atoi(s + 17);
f.SetValue(t);
}
break;
default: {
. . . . .
Thanks!
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
|
Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
By: unodgs on Mon, 23 January 2017 07:34
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
By: Klugier on Mon, 23 January 2017 09:38
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
By: mirek on Wed, 25 January 2017 11:30
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
By: Klugier on Wed, 25 January 2017 18:42
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
By: mirek on Wed, 25 January 2017 19:02
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
By: mirek on Wed, 25 January 2017 19:49
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
By: mirek on Wed, 25 January 2017 20:40
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
By: mirek on Thu, 26 January 2017 14:10
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
By: mirek on Thu, 26 January 2017 15:01
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
By: mirek on Thu, 26 January 2017 09:09
|
|
|
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
By: Klugier on Wed, 25 January 2017 19:03
|
Goto Forum:
Current Time: Mon May 13 08:39:53 CEST 2024
Total time taken to generate the page: 0.02665 seconds
|
|
|