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

authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
changeset559f59a7912f
branchdefault
phasepublic
hiddenno
parent revision#e9fd4ff9ef14 backport stable
child revision#845f4fad765b merge back stable changes
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
# Node ID 559f59a7912f28a80e2e839b96d0a736509ca19b
# Parent e9fd4ff9ef14e99989c4af1f5ed44ee08985836d
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