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

MCOL-962 change mcssystemreadonly to a tri state return flag. Test for 0 to see if the system is in a writable state,

This commit is contained in:
David Hall
2018-01-30 16:07:51 -06:00
parent b3bbd89d00
commit 2bdcb159ed
3 changed files with 6 additions and 44 deletions

View File

@ -1866,7 +1866,7 @@ void mcssystemready_deinit(UDF_INIT* initid)
#ifdef _MSC_VER
__declspec(dllexport)
#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,
char* is_null, char* error)
{
@ -1875,9 +1875,13 @@ long long mcssystemreadonly(UDF_INIT* initid, UDF_ARGS* args,
try
{
if (dbrm.getSystemSuspended())
{
rtn = 1;
}
if (dbrm.isReadWrite()) // Returns 0 for writable, 5 for read only
{
rtn = 1;
rtn = 2;
}
}
catch (...)
@ -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
const char* PmSmallSideMaxMemory = "pmmaxmemorysmallside";