File: ssl-big.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 (71 lines) | stat: -rw-r--r-- 1,831 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Turn on ssl between the client and server
# and run a number of tests

-- source include/have_ssl_communication.inc
-- source include/big_test.inc
-- source include/have_64bit.inc
# No point in running with valgrind as it takes 1.5 hours
-- source include/not_valgrind.inc
# This test often times out with MemorySanitizer.
-- source include/not_msan.inc

# Save the initial number of concurrent sessions
--source include/count_sessions.inc

--disable_warnings
DROP TABLE IF EXISTS t1, t2;
--enable_warnings

#
# Bug#29579 Clients using SSL can hang the server
#

connect (ssl_con,localhost,root,,,,,SSL);

create table t1 (a int);

disconnect ssl_con;


--disable_query_log
--disable_result_log

let $count= 2000;
while ($count)
{
  connect (ssl_con,localhost,root,,,,,SSL);

  eval insert into t1 values ($count);
  dec $count;

  # This select causes the net buffer to fill as the server sends the results
  # but the client doesn't reap the results. The results are larger each time
  # through the loop, so that eventually the buffer is completely full
  # at the exact moment the server attempts to the close the connection with
  # the lock held.
  send select * from t1;

  # now send the quit the command so the server will initiate the shutdown.
  send_quit ssl_con;

  # if the server is hung, this will hang too:
  connect (ssl_con2,localhost,root,,,,,SSL);

  # no hang if we get here, close and retry
  disconnect ssl_con2;
  disconnect ssl_con;
}
--enable_query_log
--enable_result_log

connect (ssl_con,localhost,root,,,,,SSL);

drop table t1;
connection default;
disconnect ssl_con;

# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc

##  This test file is for testing encrypted communication only, not other
##  encryption routines that the SSL library happens to provide!