1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-20 09:07:44 +03:00
mariadb-columnstore-engine/mysql-test/columnstore/basic/t/mcs207_utility_functions.test
Alexander Barkov ccd6b83be5 MCOL-4678 MTR tests fail because of /tmp and ./ with LOAD DATA
Also fixing the problem with missing UDFs for the affected tests.
(see MCOL-4659 for details):
When mtr runs without --remote, the UDFs must be installed inside
the test using CREATE FUNCTION.

Note, there are still more tests left with missing UDFs. They'll be
fixed separately.
2021-04-16 09:04:25 +04:00

44 lines
1.2 KiB
Plaintext

#
# Test columnstore utility functions
# Author: Bharath, bharath.bokka@mariadb.com
#
-- source ../include/have_columnstore.inc
--disable_warnings
DROP DATABASE IF EXISTS mcs207_db;
--enable_warnings
CREATE DATABASE mcs207_db;
USE mcs207_db;
let $func_exists=`SELECT COUNT(*) FROM mysql.func WHERE name='mcssystemready'`;
--disable_query_log
if (!$func_exists)
{
CREATE FUNCTION mcssystemready RETURNS INTEGER SONAME "ha_columnstore.so";
CREATE FUNCTION mcssystemreadonly RETURNS INTEGER SONAME "ha_columnstore.so";
}
--enable_query_log
# Returns 1 if the system can accept queries, 0 if it's not ready yet
SELECT mcsSystemReady();
# Returns 1 if ColumnStore is in a writes suspended mode. That is, a user executed the SuspendDatabaseWrites.
# It returns 2 if in a read only state. ColumnStore puts itself into a read only state if it detects a logic error that may have corrupted data. Generally it means a ROLLBACK operation failed.
# Returns 0 if the system is writable.
SELECT mcsSystemReadOnly();
--disable_query_log
if (!$func_exists)
{
DROP FUNCTION mcssystemready;
DROP FUNCTION mcssystemreadonly;
}
--enable_query_log
# Clean UP
DROP DATABASE mcs207_db;