diff -r 88e20e0e1871 django/db/backends/__init__.py
a
|
b
|
|
164 | 164 | """ |
165 | 165 | return cursor.lastrowid |
166 | 166 | |
167 | | def limit_offset_sql(self, limit, offset=None): |
168 | | """ |
169 | | Returns a LIMIT/OFFSET SQL clause, given a limit and optional offset. |
170 | | """ |
171 | | # 'LIMIT 40 OFFSET 20' |
172 | | sql = "LIMIT %s" % limit |
173 | | if offset and offset != 0: |
174 | | sql += " OFFSET %s" % offset |
175 | | return sql |
176 | | |
177 | 167 | def lookup_cast(self, lookup_type): |
178 | 168 | """ |
179 | 169 | Returns the string to use in a query when performing lookups |
diff -r 88e20e0e1871 django/db/backends/mysql/base.py
a
|
b
|
|
89 | 89 | |
90 | 90 | def fulltext_search_sql(self, field_name): |
91 | 91 | return 'MATCH (%s) AGAINST (%%s IN BOOLEAN MODE)' % field_name |
92 | | |
93 | | def limit_offset_sql(self, limit, offset=None): |
94 | | # 'LIMIT 20,40' |
95 | | sql = "LIMIT " |
96 | | if offset and offset != 0: |
97 | | sql += "%s," % offset |
98 | | return sql + str(limit) |
99 | 92 | |
100 | 93 | def no_limit_value(self): |
101 | 94 | # 2**64 - 1, as recommended by the MySQL documentation |
diff -r 88e20e0e1871 django/db/backends/mysql_old/base.py
a
|
b
|
|
93 | 93 | |
94 | 94 | def fulltext_search_sql(self, field_name): |
95 | 95 | return 'MATCH (%s) AGAINST (%%s IN BOOLEAN MODE)' % field_name |
96 | | |
97 | | def limit_offset_sql(self, limit, offset=None): |
98 | | # 'LIMIT 20,40' |
99 | | sql = "LIMIT " |
100 | | if offset and offset != 0: |
101 | | sql += "%s," % offset |
102 | | return sql + str(limit) |
103 | 96 | |
104 | 97 | def no_limit_value(self): |
105 | 98 | # 2**64 - 1, as recommended by the MySQL documentation |
diff -r 88e20e0e1871 django/db/backends/oracle/base.py
a
|
b
|
|
88 | 88 | sq_name = util.truncate_name(table_name, self.max_name_length() - 3) |
89 | 89 | cursor.execute('SELECT %s_sq.currval FROM dual' % sq_name) |
90 | 90 | return cursor.fetchone()[0] |
91 | | |
92 | | def limit_offset_sql(self, limit, offset=None): |
93 | | # Limits and offset are too complicated to be handled here. |
94 | | # Instead, they are handled in django/db/backends/oracle/query.py. |
95 | | return "" |
96 | 91 | |
97 | 92 | def lookup_cast(self, lookup_type): |
98 | 93 | if lookup_type in ('iexact', 'icontains', 'istartswith', 'iendswith'): |