close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 20 years ago

Closed 20 years ago

#259 closed defect (fixed)

First date of any year, in any Serie, is not stored in DDBB

Reported by: danirus Owned by: danirus
Priority: normal Milestone:
Component: DataBase Version: head
Severity: normal Keywords:
Cc:

Description

Next code:

Struct DBStructMySQL { Text driver, Text database, Text host };
Set TolMySQL = DBStructMySQL("mysql", "toldb", "localhost");
Real DBOpen("toldb", "toluser", "mypasswd", TolMySQL);
Serie ser1 = SubSer(Gaussian(0,1,Diario), y2005m1d1, y2005m12d31);
Real DBCreateSeriesTable("series", SetOfSerie(ser1));

Creates the next first entries in my toldb Database:

0000-00-00 00:00:00 | 0.854203
2005-01-02 00:00:00 | -1.654821
2005-01-03 00:00:00 | -0.68594
2005-01-04 00:00:00 | 0.831776

The problem is always with first values for months, days, hours, minutes and
seconds.
There is no problem when the Serie starts in the second day of any month. Or
even in the first hour (not 0h) or first minute (not 0min)...

Change History (2)

comment:1 Changed 20 years ago by danirus

Status: newassigned

The problem is related with the use of BDateFormat::DateToText, found in:
http://www.tol-project.org/tolapi/dtealgeb_8cpp-source.html#l00080

A solution consists in avoid the use of those bool values (uX) when the format_
is different of BDateFormat::Defect().format_. Those uX bool variables are
useful used with BDateFormat::defect_, which is: "%cy%Ym%md%d%uh%hi%is%s". But
in the BDateFormat used when a Serie should be written in a DDBB, I said:
"%Y/%m/%d %h:%i:%s", those bool values cuts the string returned.

To apply this change I should know whether somebody is using another format.

comment:2 Changed 20 years ago by danirus

Resolution: fixed
Status: assignedclosed

This bug has been resolved and fixed.

Note: See TracTickets for help on using tickets.