fix off-by-one error in default impl of sql_restart_sequence (closes #78366)

authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
changeset33c99a39abd0
branchstable
phasepublic
hiddenno
parent revision#751a002a3fd3 Added tag logilab-database-debian-version-1.6.3-1 for changeset 7ed00415dfcf
child revision#909e49276012 merge for 1.6.4, #aee0d34f2833 merge stable heads
files modified by this revision
__init__.py
__pkginfo__.py
debian/changelog
# HG changeset patch
# User Alexandre Fayolle <alexandre.fayolle@logilab.fr>
# Date 1318252329 -7200
# Mon Oct 10 15:12:09 2011 +0200
# Branch stable
# Node ID 33c99a39abd0dff9b72806733183a92e614e7474
# Parent 751a002a3fd3c5c5c0e76402ae8d154b3a7c0cd0
fix off-by-one error in default impl of sql_restart_sequence (closes #78366)

diff --git a/__init__.py b/__init__.py
@@ -731,11 +731,11 @@
1      def sql_create_sequence(self, seq_name):
2          return '''CREATE TABLE %s (last INTEGER);
3  INSERT INTO %s VALUES (0);''' % (seq_name, seq_name)
4 
5      def sql_restart_sequence(self, seq_name, initial_value=1):
6 -        return 'UPDATE %s SET last=%s;' % (seq_name, initial_value-1)
7 +        return 'UPDATE %s SET last=%s;' % (seq_name, initial_value)
8 
9      def sql_sequence_current_state(self, seq_name):
10          return 'SELECT last FROM %s;' % seq_name
11 
12      def sql_drop_sequence(self, seq_name):
diff --git a/__pkginfo__.py b/__pkginfo__.py
@@ -17,11 +17,11 @@
13  # with logilab-database. If not, see <http://www.gnu.org/licenses/>.
14  """logilab.database packaging information."""
15 
16  distname = 'logilab-database'
17  modname = 'database'
18 -numversion = (1, 6, 3)
19 +numversion = (1, 6, 4)
20  version = '.'.join([str(num) for num in numversion])
21  license = 'LGPL'
22 
23  author = "Logilab"
24  author_email = "devel@logilab.fr"
diff --git a/debian/changelog b/debian/changelog
@@ -1,5 +1,11 @@
25 +logilab-database (1.6.4-1) unstable; urgency=low
26 +
27 +  * new upstream release
28 +
29 + -- Alexandre Fayolle <afayolle@debian.org>  Mon, 10 Oct 2011 15:02:11 +0200
30 +
31  logilab-database (1.6.3-1) unstable; urgency=low
32 
33    * new upstream release
34 
35   -- Sylvain Thénault <sylvain.thenault@logilab.fr>  Fri, 05 Aug 2011 09:12:34 +0200