Skip to content

Commit 1956e6d

Browse files
author
Richard Jones
committed
merge from maint-0-7
1 parent 89e08c8 commit 1956e6d

File tree

5 files changed

+28
-5
lines changed

5 files changed

+28
-5
lines changed

CHANGES.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Fixed:
145145
- relaxed URL designator syntax to allow issue[0]*1 (sf bug 1054523)
146146

147147

148-
2004-??-?? 0.7.12
148+
2005-05-02 0.7.12
149149
Fixed:
150150
- handle capitalisation of class names in text hyperlinking (sf bug
151151
1101043)
@@ -157,6 +157,7 @@ Fixed:
157157
- hack to fix some anydbm export problems (sf bug 1081454)
158158
- ignore AutoReply messages (sf patch 1085051)
159159
- fix ZRoundup syntax error (sf bug 1122335)
160+
- fix RDBMS clear() so it resets all class itemid counters
160161

161162

162163
2005-01-06 0.7.11

roundup/backends/back_mysql.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,13 @@ def setid(self, classname, setid):
465465
vals = (int(setid)+1, classname)
466466
self.sql(sql, vals)
467467

468+
def clear(self):
469+
rdbms_common.Database.clear(self)
470+
471+
# set the id counters to 0 (setid adds one) so we start at 1
472+
for cn in self.classes.keys():
473+
self.setid(cn, 0)
474+
468475
def create_class(self, spec):
469476
rdbms_common.Database.create_class(self, spec)
470477
sql = 'insert into ids (name, num) values (%s, %s)'

roundup/backends/back_postgresql.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,15 @@ def setid(self, classname, setid):
211211
sql = "select setval('_%s_ids', %s) from dual"%(classname, int(setid))
212212
self.sql(sql)
213213

214+
def clear(self):
215+
rdbms_common.Database.clear(self)
216+
217+
# reset the sequences
218+
for cn in self.classes.keys():
219+
self.sql('DROP SEQUENCE _%s_ids'%cn)
220+
self.sql('CREATE SEQUENCE _%s_ids'%cn)
221+
222+
214223

215224
class Class(rdbms_common.Class):
216225
pass

roundup/backends/back_sqlite.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: back_sqlite.py,v 1.36.2.4 2005-02-14 04:37:37 richard Exp $
1+
# $Id: back_sqlite.py,v 1.36.2.5 2005-05-02 05:47:53 richard Exp $
22
'''Implements a backend for SQLite.
33
44
See https://pysqlite.sourceforge.net/ for pysqlite info
@@ -325,12 +325,19 @@ def newid(self, classname):
325325
def setid(self, classname, setid):
326326
''' Set the id counter: used during import of database
327327
328-
We add one to make it behave like the seqeunces in postgres.
328+
We add one to make it behave like the sequences in postgres.
329329
'''
330330
sql = 'update ids set num=%s where name=%s'%(self.arg, self.arg)
331331
vals = (int(setid)+1, classname)
332332
self.sql(sql, vals)
333333

334+
def clear(self):
335+
rdbms_common.Database.clear(self)
336+
337+
# set the id counters to 0 (setid adds one) so we start at 1
338+
for cn in self.classes.keys():
339+
self.setid(cn, 0)
340+
334341
def create_class(self, spec):
335342
rdbms_common.Database.create_class(self, spec)
336343
sql = 'insert into ids (name, num) values (%s, %s)'

roundup/backends/rdbms_common.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.142.2.7 2005-03-03 22:12:36 richard Exp $
1+
# $Id: rdbms_common.py,v 1.142.2.8 2005-05-02 05:47:53 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -673,7 +673,6 @@ def clear(self):
673673
for cn in self.classes.keys():
674674
sql = 'delete from _%s'%cn
675675
self.sql(sql)
676-
self.setid(cn, 1)
677676

678677
#
679678
# Nodes

0 commit comments

Comments
 (0)