Fixed #350 -- 'offset' DB API parameter now works in MySQL 3. Tests from [540] pass. Thanks, ronan@cremin.com

git-svn-id: http://code.djangoproject.com/svn/django/trunk@541 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-08-19 21:51:14 +00:00
parent 9180112f02
commit e5e1ea602d
5 changed files with 21 additions and 3 deletions

View file

@ -71,6 +71,12 @@ def get_date_trunc_sql(lookup_type, field_name):
# http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC
return "DATE_TRUNC('%s', %s)" % (lookup_type, field_name)
def get_limit_offset_sql(limit, offset=None):
sql = "LIMIT %s" % limit
if offset and offset != 0:
sql += " OFFSET %s" % offset
return sql
def get_table_list(cursor):
"Returns a list of table names in the current database."
cursor.execute("""