]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
MSText no longer implicitly creates TEXT for string with no length
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 9 May 2008 19:00:55 +0000 (19:00 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 9 May 2008 19:00:55 +0000 (19:00 +0000)
(this actually allows CAST (foo, VARCHAR) to render too)

lib/sqlalchemy/databases/mysql.py
test/dialect/mysql.py
test/sql/testtypes.py

index 9cc5c38a692f8d2fae81d800cc766894fd8664e8..0f40569b18007672baf7e1237939e3e9d036fdc5 100644 (file)
@@ -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):
index 923658b014c69282b62308cb180c8037d97eab2f..6a261ddcdf802e5bf35880dc9d5a96ba7b910157 100644 (file)
@@ -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(), ),
index 9cd6f9bdb8a58f5aa3a104eae8447c4b3a9e7b56..b3331ba590b8366c5ad2de0e216f2c1a358745ae 100644 (file)
@@ -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)