Closed Bug 331343 Opened 20 years ago Closed 20 years ago

The timestamp is quoted twice in Bugzilla::Flag::modify()

Categories

(Bugzilla :: Attachments & Requests, defect)

2.22
defect
Not set
major

Tracking

()

RESOLVED FIXED
Bugzilla 2.22

People

(Reporter: lixan, Assigned: LpSolit)

Details

(Keywords: dataloss)

Attachments

(1 file)

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 2.0.50215) Build Identifier: parameter $timestamp in function Bugzilla::flag::modify allready quoted by function Bugzilla::flag::process, but quoted again Reproducible: Always Steps to Reproduce:
Version: unspecified → 2.22
This is a known bug. It will be fixed by bug 300549.
Assignee: create-and-change → LpSolit
Severity: normal → minor
Status: UNCONFIRMED → NEW
Component: Creating/Changing Bugs → Attachments & Requests
Depends on: 300549
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Whiteboard: [blocker will fix]
Target Milestone: --- → Bugzilla 2.24
Bug 300549 milestone 2.24. But this bug block using flags in 2.22
Severity: minor → major
(In reply to comment #2) > But this bug block using flags in 2.22 You can still use flags in 2.22. I don't think I will fix this bug in 2.22. It will depend on how invasive it is.
This allways reproducible in 2.22 rc1 Step to reproduce: 1. Add flag (If you have one, don't needed). 2. Set flag (in show_bug.cgi) to question '?'. 3. Press "Commit" 3. Update bug. 4. Set flag to '+'. 5. Press "Commit". And you will get errror in process_bug.cgi DBD::mysql::st execute failed: Incorrect datetime value: ''2006-03-24 08:25:23'' for column 'modification_date' Bugzilla::DB::SendSQL('UPDATE flags\x{a} SET setter_id = 1,\x{a} ...') called at Bugzilla/Flag.pm line 683 Bugzilla::Flag::modify('Bugzilla::CGI=HASH(0x22f1a1c)', '\'2006-03-24 08:25:23\'') called at Bugzilla/Flag.pm line 453 I am change Bugzilla\flag.pm line 612 from: my $sql_timestamp = ($timestamp ? &::SqlQuote($timestamp) : "NOW()"); to: my $sql_timestamp = ($timestamp ? $timestamp : "NOW()"); It is enough for closing bug in 2.22. Better solution correct Bugzilla::flag::process for right Bugzilla::flag::modify calling. (but this require more modifications) Of course, in version 2.24 you may fix Bug 300549, ànd this problem disappear.
Status: NEW → ASSIGNED
That's strange that you crash when changing a flag. Which version of MySQL are you using? And which version of DBD::mysql? Anyway, I will take a closer look to fix it on 2.22 as well (and maybe even on 2.20.2). We have a few days left before the release of 2.22. I will post a patch on time.
Flags: blocking2.22?
Target Milestone: Bugzilla 2.24 → Bugzilla 2.22
(In reply to comment #5) > That's strange that you crash when changing a flag. Which version of MySQL are > you using? And which version of DBD::mysql? Windows 2003 Server with SP1. Bugzilla 2.22rc1 on IIS 6.0 MySQL 5.0.18 ActivePerl 5.8.7 Build 518 DBI 1.49 DBD::mysql 3.0002 But this bug don't depend on it.
(In reply to comment #6) > But this bug don't depend on it. It depends. We cannot reproduce the problem using Apache on Linux. But I agree that quoting twice the timestamp doesn't depend on your config.
Attached patch patch, v1Splinter Review
Tested on 2.22 and 2.23.1, on both MySQL and PostgreSQL. On MySQL, due to the timestamp being quoted twice, the modification date is set to '0000-00-00 00:00:00'. This patch fixes this problem.
Attachment #217051 - Flags: review?(myk)
No longer depends on: 300549
Whiteboard: [blocker will fix]
Yeah, there's some dataloss because of this bug (the modification_date), so we should fix it before 2.22.
Flags: blocking2.22? → blocking2.22+
Keywords: dataloss
Comment on attachment 217051 [details] [diff] [review] patch, v1 Seems like it would be better to change the callers to not quote the timestamp. It's strange for a function to expect a quoted timestamp.
Attachment #217051 - Flags: review?(myk) → review-
Comment on attachment 217051 [details] [diff] [review] patch, v1 Okay, LpSolit says that this is the minimal change needed to fix the bug, and since we're so close to release I think it's a good idea to do the minimum fix. This is r+ if you add an "XXX" comment saying that we need to change things so that callers don't quote the timestamp.
Attachment #217051 - Flags: review- → review+
Flags: approval?
Flags: approval2.22?
Flags: approval?
Flags: approval2.22?
Flags: approval2.22+
Flags: approval+
tip: Checking in Bugzilla/Flag.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Flag.pm,v <-- Flag.pm new revision: 1.60; previous revision: 1.59 done 2.22rc1: Checking in Bugzilla/Flag.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Flag.pm,v <-- Flag.pm new revision: 1.59.2.1; previous revision: 1.59 done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Summary: twice SQLQuote in Bugzilla::flag::modify → The timestamp is quoted twice in Bugzilla::Flag::modify()
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: