[1.2.X] Fixed #13773 -- Passed in the current connection in a call to db_type(). Thanks to Suor for the report and patch.

Backport of r13451 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13453 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2010-07-30 02:58:51 +00:00
parent 953f4be201
commit 3227cc5951

View File

@ -63,7 +63,7 @@ class DatabaseCreation(BaseDatabaseCreation):
# a second index that specifies their operator class, which is # a second index that specifies their operator class, which is
# needed when performing correct LIKE queries outside the # needed when performing correct LIKE queries outside the
# C locale. See #12234. # C locale. See #12234.
db_type = f.db_type() db_type = f.db_type(connection=self.connection)
if db_type.startswith('varchar'): if db_type.startswith('varchar'):
output.append(get_index_sql('%s_%s_like' % (db_table, f.column), output.append(get_index_sql('%s_%s_like' % (db_table, f.column),
' varchar_pattern_ops')) ' varchar_pattern_ops'))