[vtk-developers] vtkMySQLQuery Bug

Xenophon Papademetris xenophon.papademetris at yale.edu
Mon Jul 7 17:21:49 EDT 2008


Jeff,

Thanks. Once this week is out and I have my life back ... I will e-mail a
patched file to you directly to commit.

Xenios

PS: The one other little thing that could be added (this is not a bug) is a
function of the form

vtkStdString vtkSQLQuery::GetQueryValueAsString(int value)
{
  return this->DataValue(value).ToString();

}

This will make life easier on the TCL Wrappers which don't appear to handle
the vtkVariant type all that well.



-----Original Message-----
From: Jeff Baumes [mailto:jeff.baumes at kitware.com] 
Sent: Monday, July 07, 2008 9:53 AM
To: xenophon.papademetris at yale.edu
Cc: vtk-developers at vtk.org
Subject: Re: [vtk-developers] vtkMySQLQuery Bug

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