[vtk-developers] vtkMySQLQuery Bug

Jeff Baumes jeff.baumes at kitware.com
Mon Jul 7 09:53:17 EDT 2008


Xenios,

I've done a little investigating and it looks like you are right,
there is a bug in the VTK MySQL drivers (and possibly others). The
ideal situation would be that date/time fields get encoded as a
vtkTypeUInt64 (which is typedef-ed to a C++ basic type), which stores
the number of milliseconds from midnight (for time-of-day) or number
of milliseconds from an epoch time (for date or date+time). This
special "VTK-time" encoding may be decoded by vtkTimePointUtility or
vtkTimePointToString.

A short-term solution would be to just return the values as strings
from the database, which the application can parse as necessary.

I'll enter a bug in the VTK bug tracker, but I don't know when I would
get to it. If you can work out a patch for this problem, I'd be happy
to apply it.

Jeff

On Wed, Jul 2, 2008 at 10:32 AM, Xenophon Papademetris
<xenophon.papademetris at yale.edu> wrote:
>
> Hi,
>
> We have been using the new SQL-related classes for a database project and
> they mostly work great. The only problem we have found (so far!) is that
> vtkMySQLQuery casts fields of type DATETIME as VTK_INT. Given that dates are
> also stored in the format "2008-05-11" this should be changed to return them
> as VTK_STRING. (This is done in the function GetFieldType())
>
> Xenios
>
>
> -----------------------------------------------------------
> Xenios Papademetris
> Assistant Professor of Diagnostic Radiology and Biomedical Engineering
> Yale University School of Medicine,
> New Haven, CT 06520-8042 USA
> http://www.bioimagesuite.org
> http://bioimaging.yale.edu/faculty/papademetris.html
>
>
>
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
>



-- 
Jeff Baumes, Ph.D.
R&D Engineer, Kitware Inc.
(518) 371-3971 x132
jeff.baumes at kitware.com



More information about the vtk-developers mailing list