1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-07 03:22:57 +03:00

Merge pull request #389 from mariadb-corporation/MCOL-962

Mcol 962
This commit is contained in:
benthompson15
2018-02-05 15:55:59 -06:00
committed by GitHub
3 changed files with 10 additions and 48 deletions

View File

@@ -1824,7 +1824,7 @@ __declspec(dllexport)
#endif #endif
// Return 1 if system is ready for reads or 0 if not. // Return 1 if system is ready for reads or 0 if not.
long long mcssystemready(UDF_INIT* initid, UDF_ARGS* args, long long mcssystemready(UDF_INIT* initid, UDF_ARGS* args,
char* is_null, char* error) char* is_null, char* error)
{ {
long long rtn = 0; long long rtn = 0;
Oam oam; Oam oam;
@@ -1853,7 +1853,7 @@ __declspec(dllexport)
#endif #endif
my_bool mcssystemready_init(UDF_INIT* initid, UDF_ARGS* args, char* message) my_bool mcssystemready_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
{ {
return 0; return 0;
} }
#ifdef _MSC_VER #ifdef _MSC_VER
@@ -1866,19 +1866,23 @@ void mcssystemready_deinit(UDF_INIT* initid)
#ifdef _MSC_VER #ifdef _MSC_VER
__declspec(dllexport) __declspec(dllexport)
#endif #endif
// Return 1 if system is read only; 0 if writeable // Return non-zero if system is read only; 0 if writeable
long long mcssystemreadonly(UDF_INIT* initid, UDF_ARGS* args, long long mcssystemreadonly(UDF_INIT* initid, UDF_ARGS* args,
char* is_null, char* error) char* is_null, char* error)
{ {
long long rtn = 0; long long rtn = 0;
DBRM dbrm(true); DBRM dbrm(true);
try try
{ {
if (dbrm.isReadWrite()) // Returns 0 for writable, 5 for read only if (dbrm.getSystemSuspended())
{ {
rtn = 1; rtn = 1;
} }
if (dbrm.isReadWrite() > 0) // Returns 0 for writable, 5 for read only
{
rtn = 2;
}
} }
catch (...) catch (...)
{ {
@@ -1893,7 +1897,7 @@ __declspec(dllexport)
#endif #endif
my_bool mcssystemreadonly_init(UDF_INIT* initid, UDF_ARGS* args, char* message) my_bool mcssystemreadonly_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
{ {
return 0; return 0;
} }
#ifdef _MSC_VER #ifdef _MSC_VER
@@ -1903,46 +1907,6 @@ void mcssystemreadonly_deinit(UDF_INIT* initid)
{ {
} }
#ifdef _MSC_VER
__declspec(dllexport)
#endif
// Return 1 if system is read only; 0 if writeable
long long mcswritessuspended(UDF_INIT* initid, UDF_ARGS* args,
char* is_null, char* error)
{
long long rtn = 0;
DBRM dbrm(true);
try
{
if (dbrm.getSystemSuspended())
{
rtn = 1;
}
}
catch (...)
{
*error = 1;
rtn = 1;
}
return rtn;
}
#ifdef _MSC_VER
__declspec(dllexport)
#endif
my_bool mcswritessuspended_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
{
return 0;
}
#ifdef _MSC_VER
__declspec(dllexport)
#endif
void mcswritessuspended_deinit(UDF_INIT* initid)
{
}
#define MAXSTRINGLENGTH 50 #define MAXSTRINGLENGTH 50
const char* PmSmallSideMaxMemory = "pmmaxmemorysmallside"; const char* PmSmallSideMaxMemory = "pmmaxmemorysmallside";

View File

@@ -84,7 +84,6 @@ CREATE FUNCTION idbpartition RETURNS STRING soname 'libcalmysql.so';
CREATE FUNCTION idblocalpm RETURNS INTEGER soname 'libcalmysql.so'; CREATE FUNCTION idblocalpm RETURNS INTEGER soname 'libcalmysql.so';
CREATE FUNCTION mcssystemready RETURNS INTEGER soname 'libcalmysql.so'; CREATE FUNCTION mcssystemready RETURNS INTEGER soname 'libcalmysql.so';
CREATE FUNCTION mcssystemreadonly RETURNS INTEGER soname 'libcalmysql.so'; CREATE FUNCTION mcssystemreadonly RETURNS INTEGER soname 'libcalmysql.so';
CREATE FUNCTION mcswritessuspended RETURNS INTEGER soname 'libcalmysql.so';
CREATE DATABASE IF NOT EXISTS infinidb_vtable; CREATE DATABASE IF NOT EXISTS infinidb_vtable;
CREATE DATABASE IF NOT EXISTS infinidb_querystats; CREATE DATABASE IF NOT EXISTS infinidb_querystats;

View File

@@ -11,7 +11,6 @@ CREATE FUNCTION calcleartablelock RETURNS STRING SONAME 'libcalmysql.dll';
CREATE FUNCTION calgetsqlcount RETURNS STRING SONAME 'libcalmysql.dll'; CREATE FUNCTION calgetsqlcount RETURNS STRING SONAME 'libcalmysql.dll';
CREATE FUNCTION mcssystemready RETURNS INTEGER SONAME 'libcalmysql.dll'; CREATE FUNCTION mcssystemready RETURNS INTEGER SONAME 'libcalmysql.dll';
CREATE FUNCTION mcssystemreadonly RETURNS INTEGER SONAME 'libcalmysql.dll'; CREATE FUNCTION mcssystemreadonly RETURNS INTEGER SONAME 'libcalmysql.dll';
CREATE FUNCTION mcswritessuspended RETURNS INTEGER SONAME 'libcalmysql.dll';
create database if not exists calpontsys; create database if not exists calpontsys;
use calpontsys; use calpontsys;