diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-06 18:45:19 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-06 18:45:19 -0500 |
| commit | 83be34c047ca6caf484c7aaaefe58fb078b3e81d (patch) | |
| tree | 861f3026863fccd7517252ff0d928f0e12974eba /lib/sqlalchemy | |
| parent | 987828194ee571c39ed461a9233191d968e4f4c7 (diff) | |
| download | sqlalchemy-83be34c047ca6caf484c7aaaefe58fb078b3e81d.tar.gz | |
- hardwire the huge LIMIT number on MySQL. this might fix the OurSQL py3k
bug we're having, though I'm not able to get a good run of OurSQL
on OSX right now either Python 2 or 3.
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/dialects/mysql/base.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index a6e8f8c21..42072699e 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -1224,9 +1224,19 @@ class MySQLCompiler(compiler.SQLCompiler): elif offset is not None: # As suggested by the MySQL docs, need to apply an # artificial limit if one wasn't provided + # http://dev.mysql.com/doc/refman/5.0/en/select.html if limit is None: - limit = 18446744073709551615 - return ' \n LIMIT %s, %s' % ( + # hardwire the upper limit. Currently + # needed by OurSQL with Python 3 + # (https://bugs.launchpad.net/oursql/+bug/686232), + # but also is consistent with the usage of the upper + # bound as part of MySQL's "syntax" for OFFSET with + # no LIMIT + return ' \n LIMIT %s, %s' % ( + self.process(sql.literal(offset)), + "18446744073709551615") + else: + return ' \n LIMIT %s, %s' % ( self.process(sql.literal(offset)), self.process(sql.literal(limit))) else: |
