Skip to content

Commit

Permalink
add some automated tests for this
Browse files Browse the repository at this point in the history
Signed-off-by: Tanzeel Khan <[email protected]>
  • Loading branch information
tanscorpio7 committed Jan 6, 2025
1 parent 367eaa6 commit 0541a26
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
13 changes: 13 additions & 0 deletions test/JDBC/expected/kill-vu-verify.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ create table tab_kill_spid(spid int)
go
create login victim_user_tds with password = '12345678';
go
select count(*) as count into #kill_temp_table from sys.dm_exec_sessions
go

-- tsql user=victim_user_tds password=12345678
select 1
Expand Down Expand Up @@ -763,3 +765,14 @@ int
0
~~END~~


IF ((SELECT COUNT(*) FROM sys.dm_exec_sessions) = (SELECT count FROM #kill_temp_table))
SELECT 'SUCESS';
ELSE
SELECT 'FAILURE expected count ==> ', (SELECT count FROM #kill_temp_table), ' actual count ==> ', count(*) from sys.dm_exec_sessions b;
GO
~~START~~
varchar
SUCESS
~~END~~

13 changes: 13 additions & 0 deletions test/JDBC/expected/single_db/kill-vu-verify.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ create table tab_kill_spid(spid int)
go
create login victim_user_tds with password = '12345678';
go
select count(*) as count into #kill_temp_table from sys.dm_exec_sessions
go

-- tsql user=victim_user_tds password=12345678
select 1
Expand Down Expand Up @@ -863,3 +865,14 @@ int
0
~~END~~


IF ((SELECT COUNT(*) FROM sys.dm_exec_sessions) = (SELECT count FROM #kill_temp_table))
SELECT 'SUCESS';
ELSE
SELECT 'FAILURE expected count ==> ', (SELECT count FROM #kill_temp_table), ' actual count ==> ', count(*) from sys.dm_exec_sessions b;
GO
~~START~~
varchar
SUCESS
~~END~~

10 changes: 9 additions & 1 deletion test/JDBC/input/kill-vu-verify.mix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ create table tab_kill_spid(spid int)
go
create login victim_user_tds with password = '12345678';
go
select count(*) as count into #kill_temp_table from sys.dm_exec_sessions
go

-- tsql user=victim_user_tds password=12345678
select 1
Expand Down Expand Up @@ -403,4 +405,10 @@ SELECT count(*) from sys.dm_exec_sessions where login_name = 'test_kill'
GO

SELECT COUNT(*) from pg_stat_activity where usename = 'test_kill'
GO
GO

IF ((SELECT COUNT(*) FROM sys.dm_exec_sessions) = (SELECT count FROM #kill_temp_table))
SELECT 'SUCESS';
ELSE
SELECT 'FAILURE expected count ==> ', (SELECT count FROM #kill_temp_table), ' actual count ==> ', count(*) from sys.dm_exec_sessions b;
GO

0 comments on commit 0541a26

Please sign in to comment.