-
Notifications
You must be signed in to change notification settings - Fork 21
/
plugins_test_56.sh
executable file
·52 lines (49 loc) · 1.95 KB
/
plugins_test_56.sh
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
#!/bin/bash
set -e
WARNINGS_BEFORE=0
WARNINGS_AFTER=0
ERROR_LOG=""
ERROR_LOG=$(mysql -N -s -e "show variables like 'log_error';" | grep -v "Warning:" | grep -o "\/.*$") || true
if [ -z ${ERROR_LOG} ]; then
echo "ERROR_LOG variable is empty!"
exit 1
fi
if [ ! -f ${ERROR_LOG} ]; then
echo "Error log file was not found!"
exit 1
fi
WARNINGS_BEFORE=$(grep -c "\[Warning\]" ${ERROR_LOG} || true)
mysql -e "CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME 'libfnv1a_udf.so'"
mysql -e "CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME 'libfnv_udf.so'"
mysql -e "CREATE FUNCTION murmur_hash RETURNS INTEGER SONAME 'libmurmur_udf.so'"
mysql -e "INSTALL PLUGIN audit_log SONAME 'audit_log.so';"
mysql -e "INSTALL PLUGIN handlersocket SONAME 'handlersocket.so';"
mysql -e "INSTALL PLUGIN scalability_metrics SONAME 'scalability_metrics.so';"
mysql -e "INSTALL PLUGIN QUERY_RESPONSE_TIME_AUDIT SONAME 'query_response_time.so';"
mysql -e "INSTALL PLUGIN QUERY_RESPONSE_TIME SONAME 'query_response_time.so';"
mysql -e "INSTALL PLUGIN QUERY_RESPONSE_TIME_READ SONAME 'query_response_time.so';"
mysql -e "INSTALL PLUGIN QUERY_RESPONSE_TIME_WRITE SONAME 'query_response_time.so';"
mysql -e "SHOW PLUGINS;"
# creating sysbench databases
mysql -e "CREATE DATABASE sbt;"
mysql -e "CREATE DATABASE sb;"
# adding world database for SE tests
mysql -e "CREATE DATABASE world;"
sed -i '18,21 s/^/-- /' /package-testing/world.sql
cat /package-testing/world.sql | mysql -D world
if [ ! -z "$1" ]; then
if [ "$1" = "ps" ]; then
mysql -e "CREATE DATABASE world2;"
cat /package-testing/world.sql | mysql -D world2
mysql < /package-testing/tokudb_compression.sql
fi
fi
if [ "$(grep -c "\[ERROR\]" ${ERROR_LOG} || true)" != "0" ]; then
echo "There's an error in error log!"
exit 1
fi
WARNINGS_AFTER=$(grep -c "\[Warning\]" ${ERROR_LOG} || true)
if [ "${WARNINGS_BEFORE}" != "${WARNINGS_AFTER}" ]; then
echo "There's a difference in number of warnings before installing plugins and after!"
exit 1
fi