fix checking of maximum number of function (closes: #71413)

authorSylvain Th?nault <sylvain.thenault@logilab.fr>
changeset48df22505858
branchdefault
phasepublic
hiddenno
parent revision#4132294c7d2a backport stable changes
child revision#8b3c9374f940 support for COUNT(DISTINCT ...) (closes: #71414)
files modified by this revision
ChangeLog
__init__.py
# HG changeset patch
# User Sylvain Thénault <sylvain.thenault@logilab.fr>
# Date 1311322503 -7200
# Fri Jul 22 10:15:03 2011 +0200
# Node ID 48df22505858d91b19a8f32278dbe7aaee4c62c4
# Parent 4132294c7d2aa5f7fb04551bae0baed44981aafb
fix checking of maximum number of function (closes: #71413)

diff --git a/ChangeLog b/ChangeLog
@@ -2,10 +2,11 @@
1  ======================================
2 
3  --
4      * [fti] exclude numbers from stop words in fti parser (closes: #69471)
5      * fix backup/restore commands for sqlite backend (closes: #69607)
6 +    * fix checking of maximum number of function (closes: #71413)
7 
8  2011-06-09  --  1.6.0
9      * new CAST function
10 
11      * new methods on db_helpers to support regexp-based pattern
diff --git a/__init__.py b/__init__.py
@@ -379,11 +379,11 @@
12      def check_nbargs(cls, nbargs):
13          if cls.minargs is not None and \
14                 nbargs < cls.minargs:
15              raise BadQuery('not enough argument for function %s' % cls.__name__)
16          if cls.maxargs is not None and \
17 -               nbargs < cls.maxargs:
18 +               nbargs > cls.maxargs:
19              raise BadQuery('too many arguments for function %s' % cls.__name__)
20      check_nbargs = classmethod(check_nbargs)
21 
22      def as_sql(self, backend, args):
23          try: