Fix MySQL query to compute number of rows per table (#1128)

The CAST should target `unsigned` rather than `integer`, so that we are compatible with MySQL 5.7. Also empty tables might have NULL entries, which we transform to zero entries here, as expected by the Lisp code.

Fixes #1127.
This commit is contained in:
Ian L 2020-04-11 17:22:02 +01:00 committed by GitHub
parent 86b6a5cb80
commit cb989e1155
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@
-- excluding
-- filter-list-to-where-clause excluding
SELECT table_name,
cast(data_length/avg_row_length as integer)
coalesce(cast(data_length/avg_row_length as unsigned), 0)
FROM information_schema.tables
WHERE table_schema = '~a'
and table_type = 'BASE TABLE'