1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-05-08 15:01:34 +03:00
mariadb-columnstore-engine/dbcon/mysql/install_mcs_mysql.sh.in
2020-07-13 13:23:12 +00:00

123 lines
5.7 KiB
Bash
Executable File

#!/bin/bash
pwprompt=" "
for arg in "$@"; do
if [ `expr -- "$arg" : '--tmpdir='` -eq 9 ]; then
tmpdir="`echo $arg | awk -F= '{print $2}'`"
else
echo "ignoring unknown argument: $arg" 1>&2
fi
done
if [[ -f /etc/mysql/debian.cnf ]]; then
MDB="/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf"
else
MDB="/usr/bin/mysql"
fi
# DELETE libcalmysql.so entries first as they are in ha_columnstore.so in 1.4.2 onwards
$MDB 2> ${tmpdir}/mysql_install.log <<EOD
DELETE FROM mysql.func WHERE dl='libcalmysql.so';
DELETE FROM mysql.func WHERE dl='ha_columnstore.so';
DELETE FROM mysql.func WHERE dl='libregr_mysql.so';
DELETE FROM mysql.func WHERE dl='libudf_mysql.so';
INSERT INTO mysql.func VALUES ('calgetstats',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('calsettrace',2,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('calsetparms',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('calflushcache',2,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('calgettrace',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('calgetversion',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('calonlinealter',2,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('calviewtablelock',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('calcleartablelock',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('callastinsertid',2,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('calgetsqlcount',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('idbpm',2,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('idbdbroot',2,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('idbsegment',2,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('idbsegmentdir',2,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('idbextentrelativerid',2,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('idbblockid',2,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('idbextentid',2,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('idbextentmin',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('idbextentmax',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('idbpartition',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('idblocalpm',2,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('mcssystemready',2,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('mcssystemreadonly',2,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('mcssystemprimary',2,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('regr_avgx',1,'libregr_mysql.so','aggregate');
INSERT INTO mysql.func VALUES ('regr_avgy',1,'libregr_mysql.so','aggregate');
INSERT INTO mysql.func VALUES ('regr_count',2,'libregr_mysql.so','aggregate');
INSERT INTO mysql.func VALUES ('regr_slope',1,'libregr_mysql.so','aggregate');
INSERT INTO mysql.func VALUES ('regr_intercept',1,'libregr_mysql.so','aggregate');
INSERT INTO mysql.func VALUES ('regr_r2',1,'libregr_mysql.so','aggregate');
INSERT INTO mysql.func VALUES ('corr',1,'libregr_mysql.so','aggregate');
INSERT INTO mysql.func VALUES ('regr_sxx',1,'libregr_mysql.so','aggregate');
INSERT INTO mysql.func VALUES ('regr_syy',1,'libregr_mysql.so','aggregate');
INSERT INTO mysql.func VALUES ('regr_sxy',1,'libregr_mysql.so','aggregate');
INSERT INTO mysql.func VALUES ('covar_pop',1,'libregr_mysql.so','aggregate');
INSERT INTO mysql.func VALUES ('covar_samp',1,'libregr_mysql.so','aggregate');
INSERT INTO mysql.func VALUES ('distinct_count',2,'libudf_mysql.so','aggregate');
INSERT INTO mysql.func VALUES ('caldisablepartitions',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('calenablepartitions',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('caldroppartitions',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('calshowpartitions',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('caldroppartitionsbyvalue',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('caldisablepartitionsbyvalue',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('calenablepartitionsbyvalue',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('calshowpartitionsbyvalue',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('moda',4,'libregr_mysql.so','aggregate');
CREATE DATABASE IF NOT EXISTS infinidb_querystats;
CREATE TABLE IF NOT EXISTS infinidb_querystats.querystats
(
queryID bigint NOT NULL AUTO_INCREMENT,
sessionID bigint DEFAULT NULL,
host varchar(50),
user varchar(50),
priority char(20),
queryType char(25),
query varchar(8000),
startTime timestamp NOT NULL,
endTime timestamp NOT NULL,
\`rows\` bigint,
errno int,
phyIO bigint,
cacheIO bigint,
blocksTouched bigint,
CPBlocksSkipped bigint,
msgInUM bigint,
msgOutUm bigint,
maxMemPct int,
blocksChanged bigint,
numTempFiles bigint,
tempFileSpace bigint,
PRIMARY KEY (queryID)
);
CREATE TABLE IF NOT EXISTS infinidb_querystats.user_priority
(
host varchar(50),
user varchar(50),
priority char(20)
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE IF NOT EXISTS infinidb_querystats.priority
(
priority char(20) primary key,
priority_level int
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
insert ignore into infinidb_querystats.priority values ('High', 100),('Medium', 66), ('Low', 33);
EOD
$MDB <@ENGINE_SUPPORTDIR@/syscatalog_mysql.sql 2>/dev/null
$MDB <@ENGINE_SUPPORTDIR@/calsetuserpriority.sql 2>/dev/null
$MDB <@ENGINE_SUPPORTDIR@/calremoveuserpriority.sql 2>/dev/null
$MDB <@ENGINE_SUPPORTDIR@/calshowprocesslist.sql 2>/dev/null
$MDB <@ENGINE_SUPPORTDIR@/columnstore_info.sql 2>/dev/null