Bug #75663 \"filtered\" field in EXPLAIN JSON output has too high precision
Submitted: 28 Jan 2015 10:12 Modified: 14 Feb 2015 16:54
Reporter: Roy Lyseng Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[28 Jan 2015 10:12] Roy Lyseng
Description:
CURRENT_TEST: main.explain_for_connection_rqg_json
--- /export/home/pb2/test/sb_2-14216798-1422357982.84/usr/share/mysql-test/r/explain_for_connection_rqg_json.result	2015-01-27 14:29:12.271435317 +0300
We have seen test result differences like this in recent test runs on 32-bit platforms

+++ /dev/shm/mtr-23032/var-debug/8/log/explain_for_connection_rqg_json.reject	2015-01-27 15:20:21.252283801 +0300
@@ -282,7 +282,7 @@
 +      "query_cost": "38.80"
      },
 @@ -22,2 +22,3 @@
-             "filtered": 6.8336,
+             "filtered": 6.8337,
 +            "using_where": true,
              "cost_info": {
 @@ -34,3 +35,2 @@

The problem here seems to be 32-bit vs. 64-bit floating point precision,
but anyway this field has to big precision. Limiting precision to two digits after
decimal point will eliminate such errors.

How to repeat:
Run main.explain_for_connection_rqg_json on 32-bit platform.

Suggested fix:
Limit precision to two digits after decimal point (like for query_cost).
[14 Feb 2015 16:54] Paul Dubois
Noted in 5.7.6 changelog.

For JSON-format EXPLAIN output, the filtered value was displayed to
an unwarranted number of digits precsion. This value is now limited
to two digits following the decimal point.