File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -11,16 +11,17 @@ def check_use_innodb(database):
11
11
:type database indexdigest.database.Database
12
12
:rtype: list[LinterEntry]
13
13
"""
14
- res = database .query_dict_rows ("SELECT table_name, engine FROM information_schema.tables "
15
- "WHERE engine <> 'InnoDB' and table_schema = '{}'" .
14
+ # in MySQL 8.0 information_schema tables columns are uppercase
15
+ res = database .query_dict_rows ("SELECT TABLE_NAME, ENGINE FROM information_schema.tables "
16
+ "WHERE ENGINE <> 'InnoDB' and TABLE_SCHEMA = '{}'" .
16
17
format (database .db_name ))
17
18
18
19
for row in res :
19
20
context = OrderedDict ()
20
- context ['schema' ] = database .get_table_schema (row ['table_name ' ])
21
- context ['engine' ] = row ['engine ' ]
21
+ context ['schema' ] = database .get_table_schema (row ['TABLE_NAME ' ])
22
+ context ['engine' ] = row ['ENGINE ' ]
22
23
23
- yield LinterEntry (linter_type = 'use_innodb' , table_name = row ['table_name ' ],
24
- message = '"{table_name }" uses {engine } storage engine' .
24
+ yield LinterEntry (linter_type = 'use_innodb' , table_name = row ['TABLE_NAME ' ],
25
+ message = '"{TABLE_NAME }" uses {ENGINE } storage engine' .
25
26
format (** row ),
26
27
context = context )
You can’t perform that action at this time.
0 commit comments