You've already forked mariadb-columnstore-engine
							
							
				mirror of
				https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
				synced 2025-11-03 17:13:17 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			120 lines
		
	
	
		
			5.7 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			120 lines
		
	
	
		
			5.7 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/bash
 | 
						|
#
 | 
						|
# $Id$
 | 
						|
#
 | 
						|
 | 
						|
rpmmode=install
 | 
						|
pwprompt=" "
 | 
						|
 | 
						|
for arg in "$@"; do
 | 
						|
	if [ `expr -- "$arg" : '--rpmmode='` -eq 10 ]; then
 | 
						|
		rpmmode="`echo $arg | awk -F= '{print $2}'`"
 | 
						|
	elif [ `expr -- "$arg" : '--tmpdir='` -eq 9 ]; then
 | 
						|
		tmpdir="`echo $arg | awk -F= '{print $2}'`"
 | 
						|
	else
 | 
						|
		echo "ignoring unknown argument: $arg" 1>&2
 | 
						|
	fi
 | 
						|
done
 | 
						|
 | 
						|
# DELETE libcalmysql.so entries first as they are in ha_columnstore.so in 1.4.2 onwards
 | 
						|
su -s /bin/sh -c 'mysql'  mysql 2> ${tmpdir}/mysql_install.log <<EOD
 | 
						|
DELETE FROM mysql.func WHERE dl='libcalmysql.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
 | 
						|
 | 
						|
su -s /bin/sh -c 'mysql <@ENGINE_SUPPORTDIR@/syscatalog_mysql.sql' mysql 2>/dev/null
 | 
						|
su -s /bin/sh -c 'mysql <@ENGINE_SUPPORTDIR@/calsetuserpriority.sql' mysql 2>/dev/null
 | 
						|
su -s /bin/sh -c 'mysql <@ENGINE_SUPPORTDIR@/calremoveuserpriority.sql' mysql 2>/dev/null
 | 
						|
su -s /bin/sh -c 'mysql <@ENGINE_SUPPORTDIR@/calshowprocesslist.sql' mysql 2>/dev/null
 | 
						|
su -s /bin/sh -c 'mysql <@ENGINE_SUPPORTDIR@/columnstore_info.sql' mysql 2>/dev/null
 | 
						|
 | 
						|
 |