mirror of
https://github.com/django/django.git
synced 2025-10-05 16:20:26 +00:00
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:
parent
9180112f02
commit
e5e1ea602d
5 changed files with 21 additions and 3 deletions
|
@ -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("""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue