summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/databases/mysql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2005-12-07 01:37:55 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2005-12-07 01:37:55 +0000
commit44abaa9e567e6c412a2ce499907c65d97aa865dc (patch)
tree220c93883b683dcbaf2791a4caf269320abca1d1 /lib/sqlalchemy/databases/mysql.py
parent478b0e15ed70ae109e76b696efe151b7acac036b (diff)
downloadsqlalchemy-44abaa9e567e6c412a2ce499907c65d97aa865dc.tar.gz
added rudimentary support for limit and offset (with the hack version in oracle)
fixed up order_by to support a list/scalar of columns or asc/desc fixed up query.py unit test
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r--lib/sqlalchemy/databases/mysql.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py
index 9e3f677d1..1eef6facb 100644
--- a/lib/sqlalchemy/databases/mysql.py
+++ b/lib/sqlalchemy/databases/mysql.py
@@ -175,7 +175,16 @@ class MySQLTableImpl(sql.TableImpl):
rowid_column = property(lambda s: s._rowid_col())
class MySQLCompiler(ansisql.ANSICompiler):
- pass
+ def limit_clause(self, select):
+ text = ""
+ if select.limit is not None:
+ text += " \n LIMIT " + str(select.limit)
+ if select.offset is not None:
+ if select.limit is None:
+ # striaght from the MySQL docs, I kid you not
+ text += " \n LIMIT 18446744073709551615"
+ text += " OFFSET " + str(select.offset)
+ return text
class MySQLSchemaGenerator(ansisql.ANSISchemaGenerator):
def get_column_specification(self, column, override_pk=False, first_pk=False):