class CRM_Utils_SQL

Just another collection of static utils functions.

Methods

static array
mergeSubquery(string $entity, string $joinColumn = 'id')

Helper function for adding the permissioned subquery from one entity onto another

static array
getSqlModes()

Get current sqlModes of the session

static mixed
supportsFullGroupBy() deprecated

Checks if this system enforce the MYSQL mode ONLY_FULL_GROUP_BY.

static bool
disableFullGroupByMode()

Disable ONLY_FULL_GROUP_BY for MySQL versions lower then 5.7

static bool
isGroupByModeInDefault()

CHeck if ONLY_FULL_GROUP_BY is in the global sql_modes

static 
supportsMultipleLocks()

Does the DB version support mutliple locks per

static string
getDatabaseVersion()

Get the version string for the database.

Details

at line 43
static array mergeSubquery(string $entity, string $joinColumn = 'id')

Helper function for adding the permissioned subquery from one entity onto another

Parameters

string $entity
string $joinColumn

Return Value

array

at line 66
static array getSqlModes()

Get current sqlModes of the session

Return Value

array

at line 79
static mixed supportsFullGroupBy() deprecated

deprecated

Checks if this system enforce the MYSQL mode ONLY_FULL_GROUP_BY.

This function should be named supportsAnyValueAndEnforcesFullGroupBY(), but should be deprecated instead.

Return Value

mixed

at line 95
static bool disableFullGroupByMode()

Disable ONLY_FULL_GROUP_BY for MySQL versions lower then 5.7

Return Value

bool

at line 114
static bool isGroupByModeInDefault()

CHeck if ONLY_FULL_GROUP_BY is in the global sql_modes

Return Value

bool

at line 131
static supportsMultipleLocks()

Does the DB version support mutliple locks per

https://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_get-lock

This is a conservative measure to introduce the change which we expect to deprecate later.

at line 151
static string getDatabaseVersion()

Get the version string for the database.

Return Value

string