Bug 68533

Summary: EDITING: SQL timestamp bug
Product: LibreOffice Reporter: Tomonori Hoshi <ohoshisama.twinkle>
Component: BaseAssignee: Not Assigned <libreoffice-bugs>
Status: CLOSED WONTFIX    
Severity: normal CC: iplaw67
Priority: medium    
Version: 4.1.0.4 release   
Hardware: Other   
OS: Windows (All)   
Whiteboard: BSA
Crash report or crash signature: Regression By:
Attachments: A database document which shows the explained bug.

Description Tomonori Hoshi 2013-08-25 14:26:13 UTC
Created attachment 84595 [details]
A database document which shows the explained bug.

Problem description: 
I tried to use SQL command ("alter table "table name" add "col name" timestamp default now") to acquire timestamp from system. It seems not to be working under current version, 4.1.0.4. 

Mainly, I referred this website: http://blog.jamesrhall.com/2012/11/openoffice-libreoffice-base-timestamp.html


Steps to reproduce:
1. Open Base>tool>SQL
2. Type "alter table "table name" add "col name" timestamp default now" and execute
3. See table

Current behavior:
The system just shows "25/08/13 00:00" and it never changes its time(00:00).

Expected behavior:
Time should be correctly updated.

              
Operating System: Windows 7
Version: 4.1.0.4 release
Comment 1 Alex Thurgood 2013-08-26 09:47:41 UTC
This is what appears in the SCRIPT file of the ODB file you uploaded (this file is held within the ODB, which is a zipped container containing other configuration data and the db data) :


SET DATABASE COLLATION "Latin1_General"
CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE CACHED TABLE "Lisa"("ID" INTEGER NOT NULL PRIMARY KEY,"name" VARCHAR(100),"Number" CHAR(100),"Times" TIMESTAMP DEFAULT CURRENT_TIMESTAMP)
SET TABLE "Lisa" INDEX'184 0'
CREATE USER SA PASSWORD ""
GRANT DBA TO SA
SET WRITE_DELAY 60


If you create a new entry, the timestamp will be inserted correctly, at least on my testing this is the case with LO 4.2 master build for OSX 10.8.4.

However, hsqldb 1.8.0 will not automatically update existing timestamp values :

http://forum.openoffice.org/en/forum/viewtopic.php?f=13&t=2002

to do that you need to write a trigger in Java or Basic. This is not a LibreOffice problem per se and it will not be addressed in the future, as the project is switching to Firebird for the embedded db engine.


Setting as WONTFIX.

Alex