OmniSciDB
a5dc49c757
|
Functions to support the LIKE and ILIKE operator in SQL. Only single-byte character set is supported for now. More...
#include "StringLike.h"
Go to the source code of this file.
Macros | |
#define | STR_LIKE_SIMPLE_NULLABLE(base_func) |
#define | STR_LIKE_NULLABLE(base_func) |
#define | STR_CMP_NULLABLE(base_func) |
Enumerations | |
enum | LikeStatus { kLIKE_TRUE, kLIKE_FALSE, kLIKE_ABORT, kLIKE_ERROR } |
Functions | |
static DEVICE int | lowercase (char c) |
RUNTIME_EXPORT DEVICE bool | string_like_simple (const char *str, const int32_t str_len, const char *pattern, const int32_t pat_len, char escape_char) |
RUNTIME_EXPORT DEVICE bool | string_ilike_simple (const char *str, const int32_t str_len, const char *pattern, const int32_t pat_len, char escape_char) |
static DEVICE LikeStatus | string_like_match (const char *str, const int32_t str_len, const char *pattern, const int32_t pat_len, const char escape_char, const bool is_ilike) |
RUNTIME_EXPORT DEVICE bool | string_like (const char *str, const int32_t str_len, const char *pattern, const int32_t pat_len, const char escape_char) |
RUNTIME_EXPORT DEVICE bool | string_ilike (const char *str, const int32_t str_len, const char *pattern, const int32_t pat_len, const char escape_char) |
RUNTIME_EXPORT DEVICE int32_t | StringCompare (const char *s1, const int32_t s1_len, const char *s2, const int32_t s2_len) |
RUNTIME_EXPORT DEVICE bool | string_lt (const char *lhs, const int32_t lhs_len, const char *rhs, const int32_t rhs_len) |
RUNTIME_EXPORT DEVICE bool | string_le (const char *lhs, const int32_t lhs_len, const char *rhs, const int32_t rhs_len) |
RUNTIME_EXPORT DEVICE bool | string_gt (const char *lhs, const int32_t lhs_len, const char *rhs, const int32_t rhs_len) |
RUNTIME_EXPORT DEVICE bool | string_ge (const char *lhs, const int32_t lhs_len, const char *rhs, const int32_t rhs_len) |
RUNTIME_EXPORT DEVICE bool | string_eq (const char *lhs, const int32_t lhs_len, const char *rhs, const int32_t rhs_len) |
RUNTIME_EXPORT DEVICE bool | string_ne (const char *lhs, const int32_t lhs_len, const char *rhs, const int32_t rhs_len) |
Functions to support the LIKE and ILIKE operator in SQL. Only single-byte character set is supported for now.
Definition in file StringLike.cpp.
#define STR_CMP_NULLABLE | ( | base_func | ) |
Definition at line 350 of file StringLike.cpp.
#define STR_LIKE_NULLABLE | ( | base_func | ) |
Definition at line 290 of file StringLike.cpp.
#define STR_LIKE_SIMPLE_NULLABLE | ( | base_func | ) |
Definition at line 78 of file StringLike.cpp.
enum LikeStatus |
Enumerator | |
---|---|
kLIKE_TRUE | |
kLIKE_FALSE | |
kLIKE_ABORT | |
kLIKE_ERROR |
Definition at line 26 of file StringLike.cpp.
|
inlinestatic |
Definition at line 34 of file StringLike.cpp.
Referenced by string_ilike_simple(), and string_like_match().
RUNTIME_EXPORT DEVICE bool string_eq | ( | const char * | lhs, |
const int32_t | lhs_len, | ||
const char * | rhs, | ||
const int32_t | rhs_len | ||
) |
Definition at line 336 of file StringLike.cpp.
References StringCompare().
Referenced by StringDictionary::getCompare().
RUNTIME_EXPORT DEVICE bool string_ge | ( | const char * | lhs, |
const int32_t | lhs_len, | ||
const char * | rhs, | ||
const int32_t | rhs_len | ||
) |
Definition at line 329 of file StringLike.cpp.
References StringCompare().
RUNTIME_EXPORT DEVICE bool string_gt | ( | const char * | lhs, |
const int32_t | lhs_len, | ||
const char * | rhs, | ||
const int32_t | rhs_len | ||
) |
Definition at line 322 of file StringLike.cpp.
References StringCompare().
RUNTIME_EXPORT DEVICE bool string_ilike | ( | const char * | str, |
const int32_t | str_len, | ||
const char * | pattern, | ||
const int32_t | pat_len, | ||
const char | escape_char | ||
) |
Definition at line 261 of file StringLike.cpp.
References kLIKE_TRUE, and string_like_match().
Referenced by StringDictionaryProxy::getLike(), and StringDictionary::getLikeImpl().
RUNTIME_EXPORT DEVICE bool string_ilike_simple | ( | const char * | str, |
const int32_t | str_len, | ||
const char * | pattern, | ||
const int32_t | pat_len, | ||
char | escape_char | ||
) |
Definition at line 61 of file StringLike.cpp.
References lowercase().
Referenced by StringDictionaryProxy::getLike(), and StringDictionary::getLikeImpl().
RUNTIME_EXPORT DEVICE bool string_le | ( | const char * | lhs, |
const int32_t | lhs_len, | ||
const char * | rhs, | ||
const int32_t | rhs_len | ||
) |
Definition at line 315 of file StringLike.cpp.
References StringCompare().
RUNTIME_EXPORT DEVICE bool string_like | ( | const char * | str, |
const int32_t | str_len, | ||
const char * | pattern, | ||
const int32_t | pat_len, | ||
const char | escape_char | ||
) |
Definition at line 250 of file StringLike.cpp.
References kLIKE_TRUE, and string_like_match().
Referenced by StringDictionaryProxy::getLike(), and StringDictionary::getLikeImpl().
|
static |
Definition at line 98 of file StringLike.cpp.
References kLIKE_ABORT, kLIKE_ERROR, kLIKE_FALSE, kLIKE_TRUE, and lowercase().
Referenced by string_ilike(), and string_like().
RUNTIME_EXPORT DEVICE bool string_like_simple | ( | const char * | str, |
const int32_t | str_len, | ||
const char * | pattern, | ||
const int32_t | pat_len, | ||
char | escape_char | ||
) |
Definition at line 43 of file StringLike.cpp.
Referenced by StringDictionaryProxy::getLike(), and StringDictionary::getLikeImpl().
RUNTIME_EXPORT DEVICE bool string_lt | ( | const char * | lhs, |
const int32_t | lhs_len, | ||
const char * | rhs, | ||
const int32_t | rhs_len | ||
) |
Definition at line 308 of file StringLike.cpp.
References StringCompare().
Referenced by StringDictionary::getCompare(), StringDictionary::mergeSortedCache(), and StringDictionary::sortCache().
RUNTIME_EXPORT DEVICE bool string_ne | ( | const char * | lhs, |
const int32_t | lhs_len, | ||
const char * | rhs, | ||
const int32_t | rhs_len | ||
) |
Definition at line 343 of file StringLike.cpp.
References StringCompare().
RUNTIME_EXPORT DEVICE int32_t StringCompare | ( | const char * | s1, |
const int32_t | s1_len, | ||
const char * | s2, | ||
const int32_t | s2_len | ||
) |
Definition at line 272 of file StringLike.cpp.
Referenced by string_eq(), string_ge(), string_gt(), string_le(), string_lt(), and string_ne().