[Libreoffice-bugs] [Bug 133510] Time data (not time stamp) does not work properly.

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Mon Jun 29 20:52:16 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=133510

--- Comment #6 from Cecil Carpenter <cscj01 at gmail.com> ---
(1) MySQL Server 5.7.30-0ubuntu0.18.04.1
(2) Connection type: MySQL (Native)
(3) No special settings

I'm not sure I can get more minimalist than what I gave except for the stored
procedure code which you could execute from a terminal with a call.

So you would need two (2) Columns, one to contain the values you enter and
another to contain the running totals of time.  Both columns would have MySQL
type of Time (HH:MM:SS)

Here's the stored procedure code:

calc_track_start_times |          | CREATE DEFINER=`butch`@`%` PROCEDURE
`calc_track_start_times`(in start_volno int, in end_volno int)
Block1: begin
        declare volno, discno, sideno, trackno int;
        declare cur_volno, cur_discno, cur_side, cur_trackno int;
        declare cur_trackstarttime, cur_tracklen, next_ts_time, time_zero time;
        declare no_more_rows boolean;
        declare no_more_vols boolean;
        declare no_query_result boolean;
        declare c1 cursor for select volume_id, disc_no, side, track_no,
track_start_time, track_length from track;

        declare continue handler for not found
                set no_more_rows := TRUE;
        set no_more_rows := FALSE;
        set no_more_vols := FALSE;
        set volno := start_volno;
        set discno := 1;
        set sideno := 1;
        set trackno := 1;
        set time_zero := '00:00:00';
        open c1;
        Loop1: loop
                fetch c1 into cur_volno, cur_discno, cur_side, cur_trackno,
cur_trackstarttime, cur_tracklen;
                if no_more_rows then
                        close c1;
                        set no_more_rows := TRUE;
                        leave Loop1;
                end if;
                if no_more_vols then
                        close c1;
                        set no_more_vols := TRUE;
                        leave Loop1;
                end if;
                if cur_volno < start_volno then
                       iterate Loop1;
                end if;
                if cur_volno > end_volno then
                        close c1;
                        set no_more_vols := TRUE;
                        leave Loop1;
                end if;
                if cur_trackno = 1 then
                        set next_ts_time := time_zero;
                end if;
                call update_track_start_time (cur_volno, cur_discno, cur_side,
cur_trackno, next_ts_time);
                set next_ts_time := addtime(next_ts_time,cur_tracklen);

  end loop Loop1;
end Block1

You can do away with all the variables that deal with volume, disc, side, and
track to simplify the test to a 2 column table.  If you prefer not to do that,
you can create those columns as type integer and set the volume, disc, and side
to 1 in all rows and let the track go for 1 to n where n is the number of rows
you want to work with.

Optionally, I can send you a track table that I already have with  with all
columns filled in except the running total.  You could then run the stored
procedure against that table.


Let me know how you would like to proceed.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200629/30bf6d34/attachment.htm>


More information about the Libreoffice-bugs mailing list