Debian Codegraph @

mysql-test/suite/sys_vars/t/windowing_use_high_precision_basic.test

raw
1 # Check the default value
2 SET @orig = @@global.windowing_use_high_precision;
3 SELECT @orig;
4
5 # Confirm that we can change the value
6 SET GLOBAL windowing_use_high_precision = FALSE;
7 SELECT @@global.windowing_use_high_precision;
8 SET GLOBAL windowing_use_high_precision = TRUE;
9 SELECT @@global.windowing_use_high_precision;
10
11 # Check the type
12 -- error ER_WRONG_TYPE_FOR_VAR, ER_WRONG_VALUE_FOR_VAR
13 SET GLOBAL windowing_use_high_precision = 12.34;
14
15 -- error ER_WRONG_TYPE_FOR_VAR, ER_WRONG_VALUE_FOR_VAR
16 SET GLOBAL windowing_use_high_precision = "foobar";
17
18 -- error ER_WRONG_TYPE_FOR_VAR, ER_WRONG_VALUE_FOR_VAR
19 SET GLOBAL windowing_use_high_precision = 5;
20
21 # Confirm that is is being heeded
22
23 CREATE TABLE td(d DOUBLE);
24 INSERT INTO td VALUES (1.7976931348623157E+307);
25 INSERT INTO td VALUES (1);
26
27 SELECT d, SUM(d) OVER (ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) FROM td;
28 --skip_if_hypergraph # Depends on the query plan.
29 EXPLAIN FORMAT=JSON
30 SELECT d, SUM(d) OVER (ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) FROM td;
31
32 --echo allow unsafe optimization: result changes
33 SET SESSION windowing_use_high_precision=FALSE;
34 SELECT d, SUM(d) OVER (ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) FROM td;
35 --skip_if_hypergraph # Depends on the query plan.
36 EXPLAIN FORMAT=JSON
37 SELECT d, SUM(d) OVER (ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) FROM td;
38 SET SESSION windowing_use_high_precision=TRUE; # BACK TO DEFAULT
39
40 DROP TABLE td;