diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-12-09 03:21:18 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-12-09 03:21:18 +0000 |
commit | d56a50eb7056cfe054c03b47db3d79dab03a5638 (patch) | |
tree | c58c0bd4bd9b5ce8f7a0eb6c3bfb2104e9386f7d /lib/sqlalchemy/databases/mysql.py | |
parent | 307726dfd9f852e94ac1f354c78eb0f0a5ce2c86 (diff) | |
download | sqlalchemy-d56a50eb7056cfe054c03b47db3d79dab03a5638.tar.gz |
- support for None as precision/length in numeric types for postgres, sqlite, mysql
- postgres reflection fixes: [ticket:349] [ticket:382]
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r-- | lib/sqlalchemy/databases/mysql.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 662d276e9..b87e2d6e9 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -29,7 +29,10 @@ class MSNumeric(sqltypes.Numeric): self.zerofill = 'zerofill' in kw super(MSNumeric, self).__init__(precision, length) def get_col_spec(self): - return kw_colspec(self, "NUMERIC(%(precision)s, %(length)s)" % {'precision': self.precision, 'length' : self.length}) + if self.precision is None: + return kw_colspec(self, "NUMERIC") + else: + return kw_colspec(self, "NUMERIC(%(precision)s, %(length)s)" % {'precision': self.precision, 'length' : self.length}) class MSDecimal(MSNumeric): def get_col_spec(self): if self.precision is not None and self.length is not None: |