summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/databases/mysql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-12-09 03:21:18 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-12-09 03:21:18 +0000
commitd56a50eb7056cfe054c03b47db3d79dab03a5638 (patch)
treec58c0bd4bd9b5ce8f7a0eb6c3bfb2104e9386f7d /lib/sqlalchemy/databases/mysql.py
parent307726dfd9f852e94ac1f354c78eb0f0a5ce2c86 (diff)
downloadsqlalchemy-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.py5
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: