Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

Last modified 7 years ago

#626 closed defect (invalid)

error on commiting a new version of a wiki page

Reported by: anonymous Owned by: Jonas Borgström
Priority: high Milestone:
Component: general Version: 0.7.1
Severity: major Keywords: version
Cc: Branch:
Release Notes:
API Changes:

Description

The version number is counted from 1 and steped in increasing order. When the version goes to 10 the next version number should be 11, but trac still try to commit a page with version number 10. When I look into the source, and do some experiemence, I found sqlite think the row generated by 'select 0' only include a text column with content '0'. It made all numeric to be translate to text type, and MAX() function would caompare they in dictionary order. When the last version is 10, the result that we have got is a sequece of ('1' '2' '3' '4' '5' '6' '7' '8' '9' '10' '0'), the maximum of them is also '9' not '10' since sqlite using dictionary order.

I make a patch for it:

begin 644 trac-sql-err.patch
M+2TM('1R86,O5VEK:2YP>2YO<FEG"51H=2!*=6P@,34@,38Z,C<Z,#4@,C`P
M-`HK*RL@=')A8R]7:6MI+G!Y"51H=2!*=6P@,34@,38Z,C@Z,C8@,C`P-`I`
M0"`M-3(U+#D@*S4R-2PY($!`"B`@("`@("`@(&5L<V4Z"B`@("`@("`@("`@
M("!S96QF+G!E<FTN87-S97)T7W!E<FUI<W-I;VX@*'!E<FTN5TE+25]-3T1)
M1EDI"B`@("`@("`@(&-U<G-O<B`]('-E;&8N9&(N8W5R<V]R("@I"BT@("`@
M("`@(&-U<G-O<BYE>&5C=71E("@G4T5,14-4($U!6"AV97)S:6]N*2LQ($92
M3TT@)PHM("`@("`@("`@("`@("`@("`@("`@("`@)RA314Q%0U0@=F5R<VEO
M;B!&4D]-('=I:VD@5TA%4D4@;F%M93TE<R`G"BT@("`@("`@("`@("`@("`@
M("`@("`@("`G54Y)3TX@04Q,(%-%3$5#5"`P(&%S('9E<G-I;VXI)RP@<V5L
M9BYN86UE*0HK("`@("`@("!C=7)S;W(N97AE8W5T92`H)U-%3$5#5"!)1DY5
M3$PH34%8*'9E<G-I;VXI*S$L(#$I($923TT@)PHK("`@("`@("`@("`@("`@
M("`@("`@("`@)RA314Q%0U0@=F5R<VEO;B!&4D]-('=I:VD@5TA%4D4@;F%M
M93TE<RDG"BL@("`@("`@("`@("`@("`@("`@("`@("`L('-E;&8N;F%M92D*
M("`@("`@("`@<F]W(#T@8W5R<V]R+F9E=&-H;VYE*"D*("`@("`@("`@;F5W
A7W9E<G-I;VX@/2!I;G0H<F]W6S!=*0H@("`@("`@("`*

Aho K.F. Li

Attachments (1)

trac-sql-err.patch (663 bytes ) - added by daniel 15 years ago.
The patch, decoded

Download all attachments as: .zip

Change History (11)

comment:1 by anonymous, 15 years ago

sorry for corrupted patch file in #626. I paste it again:

begin 644 trac-sql-err.patch
M+2TM('1R86,O5VEK:2YP>2YO<FEG"51H=2!*=6P@,34@,38Z,C<Z,#4@,C`P
M-`HK*RL@=')A8R]7:6MI+G!Y"51H=2!*=6P@,34@,38Z,C@Z,C8@,C`P-`I`
M0"`M-3(U+#D@*S4R-2PY($!`"B`@("`@("`@(&5L<V4Z"B`@("`@("`@("`@
M("!S96QF+G!E<FTN87-S97)T7W!E<FUI<W-I;VX@*'!E<FTN5TE+25]-3T1)
M1EDI"B`@("`@("`@(&-U<G-O<B`]('-E;&8N9&(N8W5R<V]R("@I"BT@("`@
M("`@(&-U<G-O<BYE>&5C=71E("@G4T5,14-4($U!6"AV97)S:6]N*2LQ($92
M3TT@)PHM("`@("`@("`@("`@("`@("`@("`@("`@)RA314Q%0U0@=F5R<VEO
M;B!&4D]-('=I:VD@5TA%4D4@;F%M93TE<R`G"BT@("`@("`@("`@("`@("`@
M("`@("`@("`G54Y)3TX@04Q,(%-%3$5#5"`P(&%S('9E<G-I;VXI)RP@<V5L
M9BYN86UE*0HK("`@("`@("!C=7)S;W(N97AE8W5T92`H)U-%3$5#5"!)1DY5
M3$PH34%8*'9E<G-I;VXI*S$L(#$I($923TT@)PHK("`@("`@("`@("`@("`@
M("`@("`@("`@)RA314Q%0U0@=F5R<VEO;B!&4D]-('=I:VD@5TA%4D4@;F%M
M93TE<RDG"BL@("`@("`@("`@("`@("`@("`@("`@("`L('-E;&8N;F%M92D*
M("`@("`@("`@<F]W(#T@8W5R<V]R+F9E=&-H;VYE*"D*("`@("`@("`@;F5W
A7W9E<G-I;VX@/2!I;G0H<F]W6S!=*0H@("`@("`@("`*
`
end

comment:2 by Jonas Borgström, 15 years ago

Can you attach the file instead?

comment:3 by daniel, 15 years ago

Milestone: 0.8

by daniel, 15 years ago

Attachment: trac-sql-err.patch added

The patch, decoded

comment:4 by Jonas Borgström, 15 years ago

What sqlite and pysqlite version are you using?

comment:5 by anonymous, 15 years ago

SQLite-2.8.14 PySQLite-0.5.0

I has tried to identify type of result in sqlite console. And, I found the problem what I had said.

comment:6 by Jonas Borgström, 15 years ago

Status: newassigned

Yeah, I'm just trying to figure out why the current query seems to work for everybody else…

comment:7 by Jonas Borgström, 15 years ago

Are you even using Trac version 0.7.1? If I remember correctly this query was modified between 0.7.0 and 0.7.1 to work around a bug in sqlite.

The query in trac 0.7.1 looks like this:

        cursor.execute ('SELECT MAX(version) FROM (SELECT MAX(version)+1 '
                        'FROM wiki WHERE name=%s UNION ALL SELECT 1 '
                        'AS version)', self.name)

(from source:/tags/trac-0.7.1/trac/Wiki.py#latest)

And your patch seems to have been created against an older version of Wiki.py.

Please verify that Trac 0.7.1 has the same problem.

comment:8 by anonymous, 15 years ago

sorry..

It is my fail. After cheching the version, it is 0.6.1.

comment:9 by Jonas Borgström, 15 years ago

Resolution: invalid
Status: assignedclosed

comment:10 by Christian Boos, 7 years ago

Milestone: 0.8

(clearing report:35)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.