From 84ec085d474f5f8029a52d7f6a24deda56bdfa87 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 9 May 2008 19:00:55 +0000 Subject: [PATCH] MSText no longer implicitly creates TEXT for string with no length (this actually allows CAST (foo, VARCHAR) to render too) --- lib/sqlalchemy/databases/mysql.py | 2 +- test/dialect/mysql.py | 4 +--- test/sql/testtypes.py | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 9cc5c38a69..0f40569b18 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -910,7 +910,7 @@ class MSString(_StringType, sqltypes.String): if self.length: return self._extend("VARCHAR(%d)" % self.length) else: - return self._extend("TEXT") + return self._extend("VARCHAR") class MSChar(_StringType, sqltypes.CHAR): diff --git a/test/dialect/mysql.py b/test/dialect/mysql.py index 923658b014..6a261ddcdf 100644 --- a/test/dialect/mysql.py +++ b/test/dialect/mysql.py @@ -630,11 +630,9 @@ class TypesTest(TestBase, AssertsExecutionResults): @testing.uses_deprecated('Using String type with no length') def test_type_reflection(self): # (ask_for, roundtripped_as_if_different) - specs = [( String(), mysql.MSText(), ), - ( String(1), mysql.MSString(1), ), + specs = [( String(1), mysql.MSString(1), ), ( String(3), mysql.MSString(3), ), ( Text(), mysql.MSText(), ), - ( Unicode(), mysql.MSText(), ), ( Unicode(1), mysql.MSString(1), ), ( Unicode(3), mysql.MSString(3), ), ( UnicodeText(), mysql.MSText(), ), diff --git a/test/sql/testtypes.py b/test/sql/testtypes.py index 9cd6f9bdb8..b3331ba590 100644 --- a/test/sql/testtypes.py +++ b/test/sql/testtypes.py @@ -651,7 +651,7 @@ class DateTest(TestBase, AssertsExecutionResults): class StringTest(TestBase, AssertsExecutionResults): - + @testing.fails_on('mysql') def test_nolength_string(self): # this tests what happens with String DDL with no length. # seems like we need to decide amongst "VARCHAR" (sqlite, postgres), "TEXT" (mysql) -- 2.47.3