403Webshell
Server IP : 88.99.149.37  /  Your IP : 216.73.216.141
Web Server : nginx/1.31.2
System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64
User : muralimurth ( 1015)
PHP Version : 8.4.23
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/mysql/mysql-test/main/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/mysql/mysql-test/main/win_orderby.result
drop table if exists t0,t1;
create table t0(a int primary key);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1(
pk int,
a int,
key(pk)
);
insert into t1
select 
A.a + B.a* 10 + C.a * 100,
1
from t0 A, t0 B, t0 C;
select 
pk,
count(a) over (order by pk rows between 2 preceding and 2 following) as exp
from t1
where pk between 1 and 30
order by pk desc
limit 4;
pk	exp
30	3
29	4
28	5
27	5
drop table t0,t1;
#
# MDEV-30052: Crash with a query containing nested WINDOW clauses
#
CREATE TABLE t1 (c INT);
insert into t1 values (1),(2);
UPDATE t1 SET c=1
WHERE c=2
ORDER BY
(1 IN ((
SELECT *
FROM (SELECT * FROM t1) AS v1
GROUP BY c
WINDOW v2 AS (ORDER BY
(SELECT *
FROM t1
GROUP BY c
WINDOW v3 AS (PARTITION BY c)
)
)
))
);
drop table t1;
#
# MDEV-29359: Server crashed with heap-use-after-free in
# Field::is_null(long long) const (Just testcase)
#
CREATE TABLE t1 (id int);
INSERT INTO t1 VALUES (-1),(0),(84);
SELECT
id IN (SELECT id
FROM t1
WINDOW w AS (ORDER BY (SELECT  1
FROM t1
WHERE
EXISTS ( SELECT id
FROM t1
GROUP BY id
WINDOW w2 AS (ORDER BY id)
)
)
)
) as exp
FROM t1;
exp
1
1
1
DROP TABLE t1;
# End of 10.3 tests
#
# MDEV-32317 ref_ptrs exhaust on multiple ORDER by func from winfunc
#
select row_number() over () x;
x
1
select row_number() over (order by 1) x;
x
1
select row_number() over (order by 1, 1) x;
x
1
select row_number() over (partition by 1) x;
x
1
select row_number() over (partition by 1, 1) x;
x
1
select row_number() over (partition by 1 order by 1) x;
x
1
select row_number() over (partition by 1, 2) x;
x
1
select row_number() over (partition by 1, 2 order by 1, 1) x;
x
1
select row_number() over () x order by x;
x
1
select row_number() over () order by 1;
row_number() over ()
1
select row_number() over (order by 1) order by 1;
row_number() over (order by 1)
1
select row_number() over (order by 1, 1) order by 1;
row_number() over (order by 1, 1)
1
select row_number() over (order by 1) order by 1, 1;
row_number() over (order by 1)
1
select row_number() over (order by 1, 1) order by 1, 1;
row_number() over (order by 1, 1)
1
select row_number() over (partition by 1, 2 order by 1, 1) order by 1;
row_number() over (partition by 1, 2 order by 1, 1)
1
select row_number() over (partition by 1, 2 order by 1, 1) order by 1, 1;
row_number() over (partition by 1, 2 order by 1, 1)
1
select nullif(1, 0) order by 1;
nullif(1, 0)
1
select nullif(1, 0) order by 1, 1;
nullif(1, 0)
1
select nullif(avg(1) over (), 0) order by 1;
nullif(avg(1) over (), 0)
1.0000
select nullif(avg(1) over (order by 1), 0) order by 1;
nullif(avg(1) over (order by 1), 0)
1.0000
select nullif(avg(1) over (order by 1, 1), 0) order by 1;
nullif(avg(1) over (order by 1, 1), 0)
1.0000
select nullif(avg(1) over (partition by 1), 0) order by 1;
nullif(avg(1) over (partition by 1), 0)
1.0000
select nullif(avg(1) over (partition by 1, 2), 0) order by 1;
nullif(avg(1) over (partition by 1, 2), 0)
1.0000
select nullif(avg(1) over (), 0) order by 1, 1;
nullif(avg(1) over (), 0)
1.0000
select nullif(avg(1) over (partition by 1, 2), 0) order by 1, 1;
nullif(avg(1) over (partition by 1, 2), 0)
1.0000
select nullif(avg(1) over (partition by 1, 2), 0) order by 1, 1, 1;
nullif(avg(1) over (partition by 1, 2), 0)
1.0000
select nullif(avg(1) over (partition by 1, 2), avg(1) over ()) order by 1, 1, 1;
nullif(avg(1) over (partition by 1, 2), avg(1) over ())
NULL
select avg ( '1' ) over ( ) x where ( 1 , 1 , ( 1 , null ) ) in ( ( 1 , 1 , ( 1 , 1 ) ) ) order by x between 25 and ( ( x = x ) / x ) or x = x = avg ( null ) or x = 94 ;
x
1
select row_number() over () x order by x between 1 and (( x = x ) / x) or x = x = 1  ;
x
1
select nullif(avg(1) over (order by 1), 0) order by 1, 1, 1;
nullif(avg(1) over (order by 1), 0)
1.0000
select nullif(avg(1) over (order by 1, 1, 1, 1, 1, 1, 1), avg(2) over (order by 1, 1, 1, 1, 1, 1, 1)) x order by 1, 1, 1, 1, 1, 1;
x
1.0000
select nullif(avg(1) over (partition by -1,1,0,2,3,4,5,6,7,8 order by 1, 1, 1, 1, 1, 1, 1), avg(2) over (partition by -1,1,0,2,3,4,5,6,7,8 order by 1, 1, 1, 1, 1, 1, 1)) x order by 1, 1, 1, 1, 1, 1;
x
1.0000
select nullif(avg(1) over (partition by -1,1,0,2,3,4,5,6,7,8 order by 1, 1, 1, 1, 1, 1, 1), avg(2) over (partition by -1,1,0,2,3,4,5,6,7,8 order by 1, 1, 1, 1, 1, 1, 1)) x order by 1, 1, 1, 1, 1, 1, x between 1 and (( x = x ) / x) or x = x = 1  ;
x
1.0000
# End of 10.6 tests
#
# MDEV-28619 Server crash and UBSAN null-pointer-use in Window_funcs_sort::setup
#
create table t (c int);
select * from t order by c=row_number() over t;
ERROR HY000: Window specification with name 't' is not defined
select * union select * from t;
ERROR HY000: No tables used
explain update t set c=1 where exists (
select * from t order by c=row_number() over t);
ERROR HY000: Window specification with name 't' is not defined
select * union select * from t order by c=row_number() over t;
ERROR HY000: No tables used
explain update t set c=1 where exists (
select * union select * from t order by c=row_number() over t);
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	PRIMARY	t	system	NULL	NULL	NULL	NULL	0	Const row not found
2	SUBQUERY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
3	UNION	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
NULL	UNION RESULT	<union2,3>	ALL	NULL	NULL	NULL	NULL	NULL	
explain update t set c=1 where exists (
select * union select nullif(avg(1) over (order by 1), avg(1) over (order by 1)) x
from t order by x=row_number() over t);
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	PRIMARY	t	system	NULL	NULL	NULL	NULL	0	Const row not found
2	SUBQUERY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
3	UNION	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
NULL	UNION RESULT	<union2,3>	ALL	NULL	NULL	NULL	NULL	NULL	
explain update t set c=1 where exists (
select * union select nullif(avg(1) over (order by 1), avg(1) over (order by 1)) x
from t order by x=avg(row_number() over t));
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	PRIMARY	t	system	NULL	NULL	NULL	NULL	0	Const row not found
2	SUBQUERY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
3	UNION	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
NULL	UNION RESULT	<union2,3>	ALL	NULL	NULL	NULL	NULL	NULL	
explain update t set c=1 where exists (
select * union select nullif(avg(1) over (order by 1), avg(1) over (order by 1)) x
from t order by x=avg(row_number() over t) over (order by 1));
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	PRIMARY	t	system	NULL	NULL	NULL	NULL	0	Const row not found
2	SUBQUERY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
3	UNION	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
NULL	UNION RESULT	<union2,3>	ALL	NULL	NULL	NULL	NULL	NULL	
drop table t;
#
# End of 10.11 tests
#

Youez - 2016 - github.com/yon3zu
LinuXploit