@@ -166,7 +166,14 @@ function mixinDiscovery(MySQL, mysql) {
166166 ' numeric_scale AS "dataScale",' +
167167 ' column_type AS "columnType",' +
168168 ' is_nullable = \'YES\' AS "nullable",' +
169- ' CASE WHEN extra LIKE \'%auto_increment%\' THEN 1 ELSE 0 END AS "generated"' +
169+ `
170+ case
171+ when extra like '%virtual%' then 1
172+ when extra like '%stored%' then 1
173+ when extra LIKE '%auto_increment%' THEN 1
174+ else 0
175+ end as "generated"
176+ ` +
170177 ' FROM information_schema.columns' +
171178 ' WHERE table_schema=' + mysql . escape ( schema ) +
172179 ( table ? ' AND table_name=' + mysql . escape ( table ) : '' ) ,
@@ -181,7 +188,16 @@ function mixinDiscovery(MySQL, mysql) {
181188 ' numeric_scale AS "dataScale",' +
182189 ' column_type AS "columnType",' +
183190 ' is_nullable = \'YES\' AS "nullable",' +
184- ' CASE WHEN extra LIKE \'%auto_increment%\' THEN 1 ELSE 0 END AS "generated"' +
191+ `
192+ case
193+ when extra LIKE '%GENERATED ALWAYS%' AND extra LIKE '%VIRTUAL%' THEN 1
194+ when extra LIKE '%GENERATED ALWAYS%' AND extra LIKE '%STORED%' THEN 1
195+ when extra LIKE '%VIRTUAL%' THEN 1
196+ when extra LIKE '%STORED%' THEN 1
197+ when extra LIKE '%AUTO_INCREMENT%' THEN 1
198+ else 0
199+ end as "generated"
200+ ` +
185201 ' FROM information_schema.columns' +
186202 ( table ? ' WHERE table_name=' + mysql . escape ( table ) : '' ) ,
187203 'table_name, ordinal_position' , { } ) ;
0 commit comments