| 1 |
SET @orig = @@global.windowing_use_high_precision; |
| 2 |
SELECT @orig; |
| 3 |
@orig |
| 4 |
1 |
| 5 |
SET GLOBAL windowing_use_high_precision = FALSE; |
| 6 |
SELECT @@global.windowing_use_high_precision; |
| 7 |
@@global.windowing_use_high_precision |
| 8 |
0 |
| 9 |
SET GLOBAL windowing_use_high_precision = TRUE; |
| 10 |
SELECT @@global.windowing_use_high_precision; |
| 11 |
@@global.windowing_use_high_precision |
| 12 |
1 |
| 13 |
SET GLOBAL windowing_use_high_precision = 12.34; |
| 14 |
Got one of the listed errors |
| 15 |
SET GLOBAL windowing_use_high_precision = "foobar"; |
| 16 |
Got one of the listed errors |
| 17 |
SET GLOBAL windowing_use_high_precision = 5; |
| 18 |
Got one of the listed errors |
| 19 |
CREATE TABLE td(d DOUBLE); |
| 20 |
INSERT INTO td VALUES (1.7976931348623157E+307); |
| 21 |
INSERT INTO td VALUES (1); |
| 22 |
SELECT d, SUM(d) OVER (ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) FROM td; |
| 23 |
d SUM(d) OVER (ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) |
| 24 |
1.7976931348623158e307 1.7976931348623158e307 |
| 25 |
1 1 |
| 26 |
EXPLAIN FORMAT=JSON |
| 27 |
SELECT d, SUM(d) OVER (ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) FROM td; |
| 28 |
EXPLAIN |
| 29 |
{ |
| 30 |
"query_block": { |
| 31 |
"select_id": 1, |
| 32 |
"cost_info": { |
| 33 |
"query_cost": "0.45" |
| 34 |
}, |
| 35 |
"windowing": { |
| 36 |
"windows": [ |
| 37 |
{ |
| 38 |
"name": "<unnamed window>", |
| 39 |
"frame_buffer": { |
| 40 |
"using_temporary_table": true |
| 41 |
}, |
| 42 |
"functions": [ |
| 43 |
"sum" |
| 44 |
] |
| 45 |
} |
| 46 |
], |
| 47 |
"table": { |
| 48 |
"table_name": "td", |
| 49 |
"access_type": "ALL", |
| 50 |
"rows_examined_per_scan": 2, |
| 51 |
"rows_produced_per_join": 2, |
| 52 |
"filtered": "100.00", |
| 53 |
"cost_info": { |
| 54 |
"read_cost": "0.25", |
| 55 |
"eval_cost": "0.20", |
| 56 |
"prefix_cost": "0.45", |
| 57 |
"data_read_per_join": "32" |
| 58 |
}, |
| 59 |
"used_columns": [ |
| 60 |
"d" |
| 61 |
] |
| 62 |
} |
| 63 |
} |
| 64 |
} |
| 65 |
} |
| 66 |
Warnings: |
| 67 |
Note 1003 /* select#1 */ select `test`.`td`.`d` AS `d`,sum(`test`.`td`.`d`) OVER (ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) AS `SUM(d) OVER (ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING)` from `test`.`td` |
| 68 |
allow unsafe optimization: result changes |
| 69 |
SET SESSION windowing_use_high_precision=FALSE; |
| 70 |
SELECT d, SUM(d) OVER (ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) FROM td; |
| 71 |
d SUM(d) OVER (ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) |
| 72 |
1.7976931348623158e307 1.7976931348623158e307 |
| 73 |
1 0 |
| 74 |
EXPLAIN FORMAT=JSON |
| 75 |
SELECT d, SUM(d) OVER (ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) FROM td; |
| 76 |
EXPLAIN |
| 77 |
{ |
| 78 |
"query_block": { |
| 79 |
"select_id": 1, |
| 80 |
"cost_info": { |
| 81 |
"query_cost": "0.45" |
| 82 |
}, |
| 83 |
"windowing": { |
| 84 |
"windows": [ |
| 85 |
{ |
| 86 |
"name": "<unnamed window>", |
| 87 |
"frame_buffer": { |
| 88 |
"using_temporary_table": true, |
| 89 |
"optimized_frame_evaluation": true |
| 90 |
}, |
| 91 |
"functions": [ |
| 92 |
"sum" |
| 93 |
] |
| 94 |
} |
| 95 |
], |
| 96 |
"table": { |
| 97 |
"table_name": "td", |
| 98 |
"access_type": "ALL", |
| 99 |
"rows_examined_per_scan": 2, |
| 100 |
"rows_produced_per_join": 2, |
| 101 |
"filtered": "100.00", |
| 102 |
"cost_info": { |
| 103 |
"read_cost": "0.25", |
| 104 |
"eval_cost": "0.20", |
| 105 |
"prefix_cost": "0.45", |
| 106 |
"data_read_per_join": "32" |
| 107 |
}, |
| 108 |
"used_columns": [ |
| 109 |
"d" |
| 110 |
] |
| 111 |
} |
| 112 |
} |
| 113 |
} |
| 114 |
} |
| 115 |
Warnings: |
| 116 |
Note 1003 /* select#1 */ select `test`.`td`.`d` AS `d`,sum(`test`.`td`.`d`) OVER (ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) AS `SUM(d) OVER (ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING)` from `test`.`td` |
| 117 |
SET SESSION windowing_use_high_precision=TRUE; |
| 118 |
DROP TABLE td; |