From 3266c541b69ac5304da894deef21575dbb6d7d58 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Fri, 13 Jun 2014 11:46:50 -0500 Subject: [PATCH] fixed CAST LONGTEXT issue with mysql --- VERSION | 2 +- gluon/dal.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index e9e2f4e8..23539bf3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.9.5-trunk+timestamp.2014.06.08.00.33.23 +Version 2.9.5-trunk+timestamp.2014.06.13.11.45.40 diff --git a/gluon/dal.py b/gluon/dal.py index 4300077c..71d220a9 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -2666,6 +2666,10 @@ class MySQLAdapter(BaseAdapter): return '(%s REGEXP %s)' % (self.expand(first), self.expand(second, 'string')) + def CAST(self, first, second): + if second=='LONGTEXT': second = 'CHAR' + return 'CAST(%s AS %s)' % (first, second) + def _drop(self, table, mode): # breaks db integrity but without this mysql does not drop table table_rname = table.sqlsafe