提交 791f2016 编写于 作者: R Ryuta Kamizono

Use `quoted_scope` rather than `@config[:database]` to respect current database

Related #28399.
上级 dc107956
......@@ -59,9 +59,10 @@ def extract_expression_for_virtual_column(column)
$~[:expression].inspect
end
else
scope = quoted_scope(column.table_name)
sql = "SELECT generation_expression FROM information_schema.columns" \
" WHERE table_schema = #{quote(@config[:database])}" \
" AND table_name = #{quote(column.table_name)}" \
" WHERE table_schema = #{scope[:schema]}" \
" AND table_name = #{scope[:name]}" \
" AND column_name = #{quote(column.name)}"
select_value(sql, "SCHEMA").inspect
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册