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
|
** Setup **
SET @old_big_tables = @@SESSION.sql_big_tables;
CREATE TABLE t1(a varchar(20), b varchar(20));
INSERT INTO t1 VALUES('aa','bb');
INSERT INTO t1 VALUES('aa','bb');
INSERT INTO t1 VALUES('aa','bb');
INSERT INTO t1 VALUES('aa','bb');
INSERT INTO t1 VALUES('aa','bb');
'#--------------------FN_DYNVARS_155_01-------------------------#'
SET SESSION sql_big_tables = 1;
SET @diskTableCount = 0;
SET @tempTableCount = 0;
select count(a), b from t1 group by b;
count(a) b
5 bb
SET @diskTableCount = 1 - @diskTableCount;
SET @tempTableCount = 1 - @tempTableCount;
SELECT @diskTableCount;
@diskTableCount
1
1 Expected
SELECT @tempTableCount;
@tempTableCount
1
1 Expected
'#--------------------FN_DYNVARS_155_02-------------------------#'
SET SESSION sql_big_tables = 0;
SET @diskTableCount = 1;
SET @tempTableCount = 1;
SELECT * FROM (SELECT ta.b as a, tb.a as b FROM t1 as ta INNER JOIN t1 as tb ON ta.a = tb.a) sub;
a b
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
bb aa
SET @diskTableCount = 1 - @diskTableCount;
SET @tempTableCount = 2 - @tempTableCount;
SELECT @diskTableCount;
@diskTableCount
0
0 Expected
SELECT @tempTableCount;
@tempTableCount
1
1 Expected
'#--------------------FN_DYNVARS_155_03-------------------------#'
** Connecting con_int1 using root **
** Connection con_int1 **
SELECT @@SESSION.sql_big_tables;
@@SESSION.sql_big_tables
0
0 / FALSE Expected;
SET SESSION sql_big_tables = FALSE;
** Connecting con_int2 using root **
** Connection con_int2 **
SELECT @@SESSION.sql_big_tables;
@@SESSION.sql_big_tables
0
0 / FALSE Expected;
SET SESSION sql_big_tables = TRUE;
** Connection con_int1 **
SELECT @@SESSION.sql_big_tables;
@@SESSION.sql_big_tables
0
0 / FALSE Expected;
** Connection con_int2 **
SELECT @@SESSION.sql_big_tables;
@@SESSION.sql_big_tables
1
1 / TRUE Expected;
** Connection default **
Disconnecting Connections con_int1, con_int2
SET SESSION sql_big_tables = @old_big_tables;
DROP TABLE t1;
|