https://bugs.freedesktop.org/show_bug.cgi?id=50575

--- Comment #5 from Lionel Elie Mamane <[email protected]> 2012-06-07 12:45:03 
PDT ---
(In reply to comment #4)
> But sqlite 3 *does* support fractional seconds in at least some
> contexts.  From a terminal session, first the command interpreter that
> comes with sqlite3 ...
> 
>     $ sqlite3 ../bug_047520/bug_047520.db 
>     SQLite version 3.7.4
>     Enter ".help" for instructions
>     Enter SQL statements terminated with a ";"
>     sqlite> .mode columns
>     sqlite> select * from byTs ;
>     1           2012-04-06 12:34:56.654321  Friday    
>     2           2012-04-05 13:45:57.123456  Thursday  
>     sqlite> 

1) When putting a timestamp through a parameter of a parametric query (as
LibreOffice does), sqliteodbc will use exactly three positions after the
decimal dot, so will issue something like "SELECT * from byTs WHERE
ts='2012-04-05 13:45:57.123'". So it won't find your data because of truncation
issues. That's a bug in sqliteodbc. Even if this bug were corrected in
sqliteodbc, it still wouldn't work, because LibreOffice truncates data to *two*
positions after decimal dot. That's an imperfection in LibreOffice.

2) Now, try this in sqlite3 prompt:

   SELECT * FROM byTs WHERE ts='2012-04-05 13:45:57.1234560'

   ---> no row found, while it should find the second row.

   INSERT INTO byTs VALUES (3, '2012-04-04 15:20:22.980', 'Wednesday');  
   SELECT * FROM ByTs WHERE ts='2012-04-04 15:20:22.98';

   ---> no row found, while it should find the just inserted row, as 22.980 ==
22.98 when understood as numbers!!!

   Similarly

   INSERT INTO byTs VALUES (3, '2012-04-04 15:20:22.98', 'Wednesday');  
   SELECT * FROM ByTs WHERE ts='2012-04-04 15:20:22.980';

   That's a bug in sqlite3.




>     $ isql bug_047520
>     +---------------------------------------+
>     | Connected!                            |
>     |                                       |
>     | sql-statement                         |
>     | help [tablename]                      |
>     | quit                                  |
>     |                                       |
>     +---------------------------------------+
>     SQL> select * from byTs
>     +-----------+---------------------------------+-----------+
>     | nr        | ts                              | word      |
>     +-----------+---------------------------------+-----------+
>     | 1         | 2012-04-06 12:34:56.654321      | Friday    |
>     | 2         | 2012-04-05 13:45:57.123456      | Thursday  |
>     +-----------+---------------------------------+-----------+
>     SQLRowCount returns 2
>     2 rows fetched
>     SQL> 
> 
> 
> "The timestamps in my tables are have no fractions of seconds" is
> Heinz Repp talking about *his* data, not the data that I offered in
> <https://bugs.freedesktop.org/attachment.cgi?id=59688>.
> 
> 
> <asides>
> 
>   *Hoping* to be more helpful than a nuisance, ...
> 
>   (*) It is possible to retrieve the data successfully by disguising the
>       key column:
> 
>           select nr, cast( "ts" as char(26) ), word from byTs
> 
>       Still, I suppose there must be *some* reason for the existence
>       of class OKeySet.
> 
>   (*) One entry on my list of things to try (back before I got stuck in
>       build difficulties) was a table keyed by a DECIMAL column with
>       non-zero precision.  I may get back to that someday.
> 
>   (*) Bug 50849 "SIGSEGV: ODBC to PostgreSQL, renaming column in SELECT
>       list" shows another case of LO plus ODBC giving results different
>       from isql.
> 
> </asides>

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to