File tree 2 files changed +9
-2
lines changed 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -955,7 +955,7 @@ def _get_table_opts(self):
955
955
if self ._collation :
956
956
options .append ("DEFAULT COLLATE = {collation}" )
957
957
if self ._comment :
958
- options .append ("COMMENT = {comment}" )
958
+ options .append ("COMMENT = ' {comment}' " )
959
959
960
960
table_opts = "," .join (options )
961
961
return table_opts .format (inc = self ._auto_inc , charset = self ._charset ,
Original file line number Diff line number Diff line change @@ -256,7 +256,8 @@ def test_create_table(self):
256
256
language = self .schema .create_table (table_a ) \
257
257
.add_column (mysqlx .ColumnDef ('language_id' , mysqlx .ColumnType .INT ) \
258
258
.primary ().auto_increment ().unsigned ().not_null ()) \
259
- .set_initial_auto_increment (12 ).execute ()
259
+ .set_initial_auto_increment (12 ) \
260
+ .set_comment ("Table Comment test" ).execute ()
260
261
261
262
self .assertTrue (language .exists_in_database ())
262
263
self .assertEqual (12 ,
@@ -265,6 +266,12 @@ def test_create_table(self):
265
266
'FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = "{0}" AND '
266
267
'TABLE_NAME = "{1}"' .format (self .schema .name , table_a )) \
267
268
.execute ().fetch_all ()[0 ][0 ])
269
+ self .assertEqual ("Table Comment test" ,
270
+ self .node_session .sql (
271
+ 'SELECT TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES '
272
+ 'WHERE TABLE_SCHEMA = "{0}" '
273
+ 'AND TABLE_NAME = "{1}"' .format (self .schema .name , table_a )) \
274
+ .execute ().fetch_all ()[0 ][0 ])
268
275
269
276
# Create table with index and foreign keys
270
277
film = self .schema .create_table (table_b ) \
You can’t perform that action at this time.
0 commit comments