summaryrefslogtreecommitdiff
blob: 337e5a1efcc469b68cba8b542b129a5615cd3c9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
Description: Fix failing arithmetic tests on ppc64el
 The architecture provides a math library with 128bit precision, giving
 slightly different results on certain calculations used in tests.
 Round off the values so the output is the same on all architectures.
Author: Lars Tangvald <lars.tangvald@oracle.com>
Bug: https://bugs.mysql.com/bug.php?id=92375
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1791010
Forwarded: not-needed
Last-Update: 2018-09-11

--- a/mysql-test/include/select.inc
+++ b/mysql-test/include/select.inc
@@ -2344,12 +2344,16 @@ where key1 <= 0.6158 and key2 >= 1.3762;
 explain select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
 explain select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
 
+--replace_numeric_round 4
 select max(key1) from t1 where key1 <= 0.6158;
+--replace_numeric_round 4
 select max(key2) from t2 where key2 <= 1.6158;
 select min(key1) from t1 where key1 >= 0.3762;
 select min(key2) from t2 where key2 >= 1.3762;
+--replace_numeric_round 4
 select max(key1), min(key2) from t1, t2
 where key1 <= 0.6158 and key2 >= 1.3762;
+--replace_numeric_round 4
 select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
 select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
 
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -3418,9 +3418,9 @@ Table	Create Table
 tmp1	CREATE TEMPORARY TABLE `tmp1` (
   `c1` double DEFAULT NULL
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SELECT @a, @a - 123.4567 < 0.00001;
-@a	@a - 123.4567 < 0.00001
-123.45670318603516	1
+SELECT @a, @a - 123.4567 < 0.0001;
+@a	@a - 123.4567 < 0.0001
+123.4567	1
 DROP TEMPORARY TABLE tmp1;
 DROP PROCEDURE p1;
 
--- a/mysql-test/r/select_all.result
+++ b/mysql-test/r/select_all.result
@@ -2899,10 +2899,10 @@ Warnings:
 Note	1003	/* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5))
 select max(key1) from t1 where key1 <= 0.6158;
 max(key1)
-0.6158000230789185
+0.6158
 select max(key2) from t2 where key2 <= 1.6158;
 max(key2)
-1.6158000230789185
+1.6158
 select min(key1) from t1 where key1 >= 0.3762;
 min(key1)
 0.37619999051094055
@@ -2912,10 +2912,10 @@ min(key2)
 select max(key1), min(key2) from t1, t2
 where key1 <= 0.6158 and key2 >= 1.3762;
 max(key1)	min(key2)
-0.6158000230789185	1.3761999607086182
+0.6158	1.3762
 select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
 max(key1)
-0.6158000230789185
+0.6158
 select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
 min(key1)
 0.37619999051094055
--- a/mysql-test/r/select_all_bka.result
+++ b/mysql-test/r/select_all_bka.result
@@ -2900,10 +2900,10 @@ Warnings:
 Note	1003	/* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5))
 select max(key1) from t1 where key1 <= 0.6158;
 max(key1)
-0.6158000230789185
+0.6158
 select max(key2) from t2 where key2 <= 1.6158;
 max(key2)
-1.6158000230789185
+1.6158
 select min(key1) from t1 where key1 >= 0.3762;
 min(key1)
 0.37619999051094055
@@ -2913,10 +2913,10 @@ min(key2)
 select max(key1), min(key2) from t1, t2
 where key1 <= 0.6158 and key2 >= 1.3762;
 max(key1)	min(key2)
-0.6158000230789185	1.3761999607086182
+0.6158	1.3762
 select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
 max(key1)
-0.6158000230789185
+0.6158
 select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
 min(key1)
 0.37619999051094055
--- a/mysql-test/r/select_all_bka_nixbnl.result
+++ b/mysql-test/r/select_all_bka_nixbnl.result
@@ -2900,10 +2900,10 @@ Warnings:
 Note	1003	/* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5))
 select max(key1) from t1 where key1 <= 0.6158;
 max(key1)
-0.6158000230789185
+0.6158
 select max(key2) from t2 where key2 <= 1.6158;
 max(key2)
-1.6158000230789185
+1.6158
 select min(key1) from t1 where key1 >= 0.3762;
 min(key1)
 0.37619999051094055
@@ -2913,10 +2913,10 @@ min(key2)
 select max(key1), min(key2) from t1, t2
 where key1 <= 0.6158 and key2 >= 1.3762;
 max(key1)	min(key2)
-0.6158000230789185	1.3761999607086182
+0.6158	1.3762
 select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
 max(key1)
-0.6158000230789185
+0.6158
 select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
 min(key1)
 0.37619999051094055
--- a/mysql-test/r/select_icp_mrr.result
+++ b/mysql-test/r/select_icp_mrr.result
@@ -2899,10 +2899,10 @@ Warnings:
 Note	1003	/* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5))
 select max(key1) from t1 where key1 <= 0.6158;
 max(key1)
-0.6158000230789185
+0.6158
 select max(key2) from t2 where key2 <= 1.6158;
 max(key2)
-1.6158000230789185
+1.6158
 select min(key1) from t1 where key1 >= 0.3762;
 min(key1)
 0.37619999051094055
@@ -2912,10 +2912,10 @@ min(key2)
 select max(key1), min(key2) from t1, t2
 where key1 <= 0.6158 and key2 >= 1.3762;
 max(key1)	min(key2)
-0.6158000230789185	1.3761999607086182
+0.6158	1.3762
 select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
 max(key1)
-0.6158000230789185
+0.6158
 select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
 min(key1)
 0.37619999051094055
--- a/mysql-test/r/select_icp_mrr_bka.result
+++ b/mysql-test/r/select_icp_mrr_bka.result
@@ -2900,10 +2900,10 @@ Warnings:
 Note	1003	/* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5))
 select max(key1) from t1 where key1 <= 0.6158;
 max(key1)
-0.6158000230789185
+0.6158
 select max(key2) from t2 where key2 <= 1.6158;
 max(key2)
-1.6158000230789185
+1.6158
 select min(key1) from t1 where key1 >= 0.3762;
 min(key1)
 0.37619999051094055
@@ -2913,10 +2913,10 @@ min(key2)
 select max(key1), min(key2) from t1, t2
 where key1 <= 0.6158 and key2 >= 1.3762;
 max(key1)	min(key2)
-0.6158000230789185	1.3761999607086182
+0.6158	1.3762
 select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
 max(key1)
-0.6158000230789185
+0.6158
 select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
 min(key1)
 0.37619999051094055
--- a/mysql-test/r/select_icp_mrr_bka_nixbnl.result
+++ b/mysql-test/r/select_icp_mrr_bka_nixbnl.result
@@ -2900,10 +2900,10 @@ Warnings:
 Note	1003	/* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5))
 select max(key1) from t1 where key1 <= 0.6158;
 max(key1)
-0.6158000230789185
+0.6158
 select max(key2) from t2 where key2 <= 1.6158;
 max(key2)
-1.6158000230789185
+1.6158
 select min(key1) from t1 where key1 >= 0.3762;
 min(key1)
 0.37619999051094055
@@ -2913,10 +2913,10 @@ min(key2)
 select max(key1), min(key2) from t1, t2
 where key1 <= 0.6158 and key2 >= 1.3762;
 max(key1)	min(key2)
-0.6158000230789185	1.3761999607086182
+0.6158	1.3762
 select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
 max(key1)
-0.6158000230789185
+0.6158
 select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
 min(key1)
 0.37619999051094055
--- a/mysql-test/r/select_none.result
+++ b/mysql-test/r/select_none.result
@@ -2898,10 +2898,10 @@ Warnings:
 Note	1003	/* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5))
 select max(key1) from t1 where key1 <= 0.6158;
 max(key1)
-0.6158000230789185
+0.6158
 select max(key2) from t2 where key2 <= 1.6158;
 max(key2)
-1.6158000230789185
+1.6158
 select min(key1) from t1 where key1 >= 0.3762;
 min(key1)
 0.37619999051094055
@@ -2911,10 +2911,10 @@ min(key2)
 select max(key1), min(key2) from t1, t2
 where key1 <= 0.6158 and key2 >= 1.3762;
 max(key1)	min(key2)
-0.6158000230789185	1.3761999607086182
+0.6158	1.3762
 select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
 max(key1)
-0.6158000230789185
+0.6158
 select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
 min(key1)
 0.37619999051094055
--- a/mysql-test/r/select_none_bka.result
+++ b/mysql-test/r/select_none_bka.result
@@ -2899,10 +2899,10 @@ Warnings:
 Note	1003	/* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5))
 select max(key1) from t1 where key1 <= 0.6158;
 max(key1)
-0.6158000230789185
+0.6158
 select max(key2) from t2 where key2 <= 1.6158;
 max(key2)
-1.6158000230789185
+1.6158
 select min(key1) from t1 where key1 >= 0.3762;
 min(key1)
 0.37619999051094055
@@ -2912,10 +2912,10 @@ min(key2)
 select max(key1), min(key2) from t1, t2
 where key1 <= 0.6158 and key2 >= 1.3762;
 max(key1)	min(key2)
-0.6158000230789185	1.3761999607086182
+0.6158	1.3762
 select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
 max(key1)
-0.6158000230789185
+0.6158
 select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
 min(key1)
 0.37619999051094055
--- a/mysql-test/r/select_none_bka_nixbnl.result
+++ b/mysql-test/r/select_none_bka_nixbnl.result
@@ -2899,10 +2899,10 @@ Warnings:
 Note	1003	/* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5))
 select max(key1) from t1 where key1 <= 0.6158;
 max(key1)
-0.6158000230789185
+0.6158
 select max(key2) from t2 where key2 <= 1.6158;
 max(key2)
-1.6158000230789185
+1.6158
 select min(key1) from t1 where key1 >= 0.3762;
 min(key1)
 0.37619999051094055
@@ -2912,10 +2912,10 @@ min(key2)
 select max(key1), min(key2) from t1, t2
 where key1 <= 0.6158 and key2 >= 1.3762;
 max(key1)	min(key2)
-0.6158000230789185	1.3761999607086182
+0.6158	1.3762
 select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
 max(key1)
-0.6158000230789185
+0.6158
 select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
 min(key1)
 0.37619999051094055
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -5982,9 +5982,9 @@ CREATE TABLE t3 (f1 INT, f2 FLOAT)|
 INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)|
 SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP|
 SUM(f2)	bug25373(f1)
-6.300000071525574	1
+6.3	1
 15	2
-21.300000071525574	NULL
+21.3	NULL
 DROP FUNCTION bug25373|
 DROP TABLE t3|
 DROP DATABASE IF EXISTS mysqltest1|
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -6817,6 +6817,7 @@ LANGUAGE SQL DETERMINISTIC
 RETURN p1;|
 CREATE TABLE t3 (f1 INT, f2 FLOAT)|
 INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)|
+--replace_numeric_round 4
 SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP|
 DROP FUNCTION bug25373|
 DROP TABLE t3|
--- a/mysql-test/t/wl4435_generated.inc
+++ b/mysql-test/t/wl4435_generated.inc
@@ -246,7 +246,8 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a
 
 SHOW CREATE TABLE tmp1;
 
-SELECT @a, @a - 123.4567 < 0.00001;
+--replace_numeric_round 4
+SELECT @a, @a - 123.4567 < 0.0001;
 
 DROP TEMPORARY TABLE tmp1;
 DROP PROCEDURE p1;