[mysql] Fix SQL command in sql_change_col_type()

authorRémi Cardona <remi.cardona@logilab.fr>
changeset900d91d54f45
branchdefault
phasepublic
hiddenno
parent revision#7e9fc3d08dab [psycopg] pass extra_args down to connect()
child revision#77bcb93ccf50 Add basic support for postgresql database schemas (closes #66133)
files modified by this revision
mysql.py
# HG changeset patch
# User Rémi Cardona <remi.cardona@logilab.fr>
# Date 1389980119 -3600
# Fri Jan 17 18:35:19 2014 +0100
# Node ID 900d91d54f4563beb0ed12285f006f5a376d54f9
# Parent 7e9fc3d08dab8e8bae45c96203d9f57a0cfd52a0
[mysql] Fix SQL command in sql_change_col_type()

diff --git a/mysql.py b/mysql.py
@@ -210,11 +210,11 @@
1      def sql_change_col_type(self, table, column, coltype, null_allowed):
2          if null_allowed:
3              cmd = 'DEFAULT'
4          else:
5              cmd = 'NOT'
6 -        return 'ALTER TABLE %s MODIFY COLUMN %s %s NULL' % (
7 +        return 'ALTER TABLE %s MODIFY COLUMN %s %s %s NULL' % (
8              table, column, coltype, cmd)
9 
10      def sql_set_null_allowed(self, table, column, coltype, null_allowed):
11          return self.sql_change_col_type(table, column, coltype, null_allowed)
12