Forum

[SOLVED] After dulp...
 
Notifications
Retirer tout

[SOLVED] After dulpicating a ticket from another Ticket last update seem to be wrong.

5 Posts
2 Utilisateurs
0 Reactions
2,275 Vu
 ozed
(@ozed)
Posts: 3
Active Member
Début du sujet
 
[#6443]

Thanks for this wonderful tool

After dulicating a ticket last uodate seem to be wrong.

Data on mysql
> select id,name,lastUpdateDateTime, ts,tsd from Ticket order by id desc limit 1;
+----+----------+--------------------+---------------------+---------------------+
| id | name | lastUpdateDateTime | ts | tsd |
+----+----------+--------------------+---------------------+---------------------+
| 20 | t1 copie | NULL | 0000-00-00 00:00:00 | 2020-01-11 16:41:16 |
+----+----------+--------------------+---------------------+---------------------+
1 row in set (0.00 sec)
tsd is the real date

select distinct t.id, t.name, lastUpdateDateTime,h.operationDate , t.ts,t.tsd
-> from Ticket t, history h
-> where h.refId=t.id and ( h.operationDate >T.lastUpdateDateTime OR T.lastUpdateDateTime is NULL) order by h.operationDate desc limit 5;
+----+----------------+--------------------+---------------------+---------------------+---------------------+
| id | name | lastUpdateDateTime | operationDate | ts | tsd |
+----+----------------+--------------------+---------------------+---------------------+---------------------+
| 20 | t1 copie | NULL | 2020-01-11 16:41:16 | 0000-00-00 00:00:00 | 2020-01-11 16:41:16 |
| 18 | bugProjektor 4 | NULL | 2020-01-11 16:28:35 | 0000-00-00 00:00:00 | 2020-01-11 16:28:08 |
| 18 | bugProjektor 4 | NULL | 2020-01-11 16:28:08 | 0000-00-00 00:00:00 | 2020-01-11 16:28:08 |
| 17 | bugProjektor 3 | NULL | 2020-01-11 16:07:10 | 0000-00-00 00:00:00 | 2020-01-11 16:02:08 |
| 17 | bugProjektor 3 | NULL | 2020-01-11 16:03:44 | 0000-00-00 00:00:00 | 2020-01-11 16:02:08 |
+----+----------------+--------------------+---------------------+---------------------+---------------------+
5 rows in set (0.01 sec)

select distinct t.refId,t.refType,t.refname, h.refId,h.refType,colname,h.operationDate , t.ts,t.tsd
-> from workelement t, history h
-> where h.refId=t.id order by h.operationDate desc limit 5;
+-------+---------+----------------+-------+-------------+-------------+---------------------+---------------------+---------------------+
| refId | refType | refname | refId | refType | colname | operationDate | ts | tsd |
+-------+---------+----------------+-------+-------------+-------------+---------------------+---------------------+---------------------+
| 20 | Ticket | t1 copie | 20 | Ticket | NULL | 2020-01-11 16:41:16 | 2020-01-11 16:41:16 | 2020-01-11 16:41:16 |
| 20 | Ticket | t1 copie | 20 | WorkElement | NULL | 2020-01-11 16:41:16 | 2020-01-11 16:41:16 | 2020-01-11 16:41:16 |
| 19 | Ticket | t1 | 19 | Ticket | NULL | 2020-01-11 16:38:20 | 0000-00-00 00:00:00 | 2020-01-11 16:38:20 |
| 19 | Ticket | t1 | 19 | WorkElement | NULL | 2020-01-11 16:38:20 | 0000-00-00 00:00:00 | 2020-01-11 16:38:20 |
|
+-------+---------+----------------+-------+-------------+-------------+---------------------+---------------------+---------------------+

select distinct t.refId,t.refType,t.refname, h.refId,h.refType,colname,h.operationDate , t.ts,t.tsd from workelement t, history h where h.refId=t.id order by h.operationDate desc limit 5;
+-------+---------+----------------+-------+-------------+-------------+---------------------+---------------------+---------------------+
| refId | refType | refname | refId | refType | colname | operationDate | ts | tsd |
+-------+---------+----------------+-------+-------------+-------------+---------------------+---------------------+---------------------+
| 20 | Ticket | t1 copie | 20 | Ticket | NULL | 2020-01-11 16:41:16 | 2020-01-11 16:41:16 | 2020-01-11 16:41:16 |
| 20 | Ticket | t1 copie | 20 | WorkElement | NULL | 2020-01-11 16:41:16 | 2020-01-11 16:41:16 | 2020-01-11 16:41:16 |
| 19 | Ticket | t1 | 19 | Ticket | NULL | 2020-01-11 16:38:20 | 0000-00-00 00:00:00 | 2020-01-11 16:38:20 |
| 19 | Ticket | t1 | 19 | WorkElement | NULL | 2020-01-11 16:38:20 | 0000-00-00 00:00:00 | 2020-01-11 16:38:20 |
| 18 | Ticket | bugProjektor 4 | 18 | WorkElement | plannedWork | 2020-01-11 16:28:35 | 2020-01-11 16:28:35 | 2020-01-11 16:28:09 |
+-------+---------+----------------+-------+-------------+-------------+---------------------+---------------------+---------------------+

Sincerly


 
Posté : 11/01/2020 6:57 pm
(@babynus)
Posts: 14952
Membre Admin
 

Sorry, but I don't understand what issue you try and point out with your select.
Please explain.


 
Posté : 11/01/2020 7:40 pm
 ozed
(@ozed)
Posts: 3
Active Member
Début du sujet
 

Sorry ! I was not clear :

How to reproduice the bug on :
ProjeQtOr V8.3.1 (249) 5.6.35-log MySQL Community Server
1) Use an existing Ticket and clique on : Copy the current ticket
2° go to the > wotk > Tickets list
last update is NULL

I think that you can find the wrong lastUpdateDateTime date in table Ticket by this query :
( if you have done before action of Copy the current ticket )
SELECT distinct t.id, t.name, lastUpdateDateTime,h.operationDate
FROM Ticket t, history h
WHERE h.refId=t.id and ( h.operationDate >T.lastUpdateDateTime OR T.lastUpdateDateTime is NULL)

In order to check the updates, I added 2 colmuns to the table tickets.

`ts` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`tsd` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,

TIMESTAMP columns are automatically initializated and updated to the current date and time by the server.
It helped me to see what's going on.

find some attached files

Thanks


 
Posté : 11/01/2020 10:10 pm
(@babynus)
Posts: 14952
Membre Admin
 

Hi,

I understand better.
In fact it is designed this way (and some specific coding was done for this).
When you copy an item, it is just a draft and in most cases you'll have to make some changes before realy publishing it.
That's exactly why when you copy an item, the copy is not in the first status (recorded) but in a specific "copy" spatus.
This allows to make some changes (that will update lastUpdateDateTime) before sending emails that are sent on creation of new item.


 
Posté : 12/01/2020 1:00 am
 ozed
(@ozed)
Posts: 3
Active Member
Début du sujet
 

I understand !
Thanks for your quick responses
Ozed


 
Posté : 12/01/2020 3:23 pm
Share:
Retour en haut