File: win_big-mdev-11697.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (54 lines) | stat: -rw-r--r-- 1,878 bytes parent folder | download | duplicates (4)
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
--source include/no_valgrind_without_big.inc

set max_recursive_iterations=200000;
create table test_table (id int, random_data varchar(36), static_int int, static_varchar varchar(10));

insert into test_table(id, random_data, static_int, static_varchar)
select id, random_data, 42, 'Hello'
    from (
        with recursive data_generator(id, random_data) as (
                select 1 as id, uuid() as random_data
                union all
                select id + 1, uuid() from data_generator where id < 1000
            )
        select * from data_generator
    ) as a;

commit;

analyze table test_table;

explain select * from (select id, lead(id) over(order by id) next_id from test_table order by id) a limit 10;

select * from (select id, lead(id) over(order by id) next_id from test_table order by id) a limit 10;

drop table if exists test_table;

create table test_table (id int, random_data varchar(36), static_int int, static_varchar varchar(10));

insert into test_table(id, random_data, static_int, static_varchar)
select id, random_data, 42, 'Hello'
    from (
        with recursive data_generator(id, random_data) as (
                select 1 as id, uuid() as random_data
                union all
                select id + 1, uuid() from data_generator where id < 100000
            )
        select * from data_generator
    ) as a;

commit;

analyze table test_table;

explain select * from (select id, lead(id) over(order by id) next_id from test_table order by id) a limit 10;

flush status;
select * from (select id, lead(id) over(order by id) next_id from test_table order by id) a limit 10;
select variable_name,
       case when variable_value > 0 then 'WITH PASSES' else 'NO PASSES' end as exp
from information_schema.session_status
where variable_name like 'Sort_merge_passes';

drop table test_table;
set max_recursive_iterations=default;