mirror of
https://github.com/MariaDB/server.git
synced 2026-05-17 20:37:12 +02:00
Merge 10.5 into 10.6
This commit is contained in:
commit
4930f9c94b
187 changed files with 2116 additions and 691 deletions
|
|
@ -675,7 +675,8 @@ namespace mrn {
|
|||
&normalized, &normalized_length, NULL);
|
||||
uint16 new_blob_data_length;
|
||||
if (normalized_length <= UINT_MAX16) {
|
||||
memcpy(grn_key, normalized, normalized_length);
|
||||
if (normalized_length)
|
||||
memcpy(grn_key, normalized, normalized_length);
|
||||
if (normalized_length < *mysql_key_size) {
|
||||
memset(grn_key + normalized_length,
|
||||
'\0', *mysql_key_size - normalized_length);
|
||||
|
|
|
|||
14
storage/mroonga/vendor/groonga/lib/alloc.c
vendored
14
storage/mroonga/vendor/groonga/lib/alloc.c
vendored
|
|
@ -310,13 +310,13 @@ grn_alloc_info_free(grn_ctx *ctx)
|
|||
}
|
||||
#endif /* USE_MEMORY_DEBUG */
|
||||
|
||||
#define GRN_CTX_SEGMENT_SIZE (1<<22)
|
||||
#define GRN_CTX_SEGMENT_SIZE (1U <<22)
|
||||
#define GRN_CTX_SEGMENT_MASK (GRN_CTX_SEGMENT_SIZE - 1)
|
||||
|
||||
#define GRN_CTX_SEGMENT_WORD (1<<31)
|
||||
#define GRN_CTX_SEGMENT_VLEN (1<<30)
|
||||
#define GRN_CTX_SEGMENT_LIFO (1<<29)
|
||||
#define GRN_CTX_SEGMENT_DIRTY (1<<28)
|
||||
#define GRN_CTX_SEGMENT_WORD (1U <<31)
|
||||
#define GRN_CTX_SEGMENT_VLEN (1U <<30)
|
||||
#define GRN_CTX_SEGMENT_LIFO (1U <<29)
|
||||
#define GRN_CTX_SEGMENT_DIRTY (1U <<28)
|
||||
|
||||
void
|
||||
grn_alloc_init_ctx_impl(grn_ctx *ctx)
|
||||
|
|
@ -400,8 +400,8 @@ grn_ctx_alloc(grn_ctx *ctx, size_t size, int flags,
|
|||
header[0] = i;
|
||||
header[1] = (int32_t) size;
|
||||
} else {
|
||||
i = ctx->impl->currseg;
|
||||
mi = &ctx->impl->segs[i];
|
||||
if ((i = ctx->impl->currseg) >= 0)
|
||||
mi = &ctx->impl->segs[i];
|
||||
if (i < 0 || size + mi->nref > GRN_CTX_SEGMENT_SIZE) {
|
||||
for (i = 0, mi = ctx->impl->segs;; i++, mi++) {
|
||||
if (i >= GRN_CTX_N_SEGMENTS) {
|
||||
|
|
|
|||
2
storage/mroonga/vendor/groonga/lib/db.c
vendored
2
storage/mroonga/vendor/groonga/lib/db.c
vendored
|
|
@ -12494,7 +12494,7 @@ grn_db_init_builtin_types(grn_ctx *ctx)
|
|||
GRN_OBJ_KEY_VAR_SIZE, 1 << 16);
|
||||
if (!obj || DB_OBJ(obj)->id != GRN_DB_TEXT) { return GRN_FILE_CORRUPT; }
|
||||
obj = deftype(ctx, "LongText",
|
||||
GRN_OBJ_KEY_VAR_SIZE, 1 << 31);
|
||||
GRN_OBJ_KEY_VAR_SIZE, 1U << 31);
|
||||
if (!obj || DB_OBJ(obj)->id != GRN_DB_LONG_TEXT) { return GRN_FILE_CORRUPT; }
|
||||
obj = deftype(ctx, "TokyoGeoPoint",
|
||||
GRN_OBJ_KEY_GEO_POINT, sizeof(grn_geo_point));
|
||||
|
|
|
|||
4
storage/mroonga/vendor/groonga/lib/pat.c
vendored
4
storage/mroonga/vendor/groonga/lib/pat.c
vendored
|
|
@ -899,7 +899,7 @@ chop(grn_ctx *ctx, grn_pat *pat, const char **key, const char *end, uint32_t *lk
|
|||
case GRN_OBJ_KEY_FLOAT :\
|
||||
if ((size) == sizeof(int64_t)) {\
|
||||
int64_t v = *(int64_t *)(key);\
|
||||
v ^= ((v >> 63)|(1LL << 63));\
|
||||
v ^= ((v >> 63)|(1ULL << 63));\
|
||||
grn_hton((keybuf), &v, (size));\
|
||||
}\
|
||||
break;\
|
||||
|
|
@ -924,7 +924,7 @@ chop(grn_ctx *ctx, grn_pat *pat, const char **key, const char *end, uint32_t *lk
|
|||
if ((size) == sizeof(int64_t)) {\
|
||||
int64_t v;\
|
||||
grn_hton(&v, (key), (size));\
|
||||
*((int64_t *)(keybuf)) = v ^ (((v^(1LL<<63))>> 63)|(1LL<<63)); \
|
||||
*((int64_t *)(keybuf)) = v ^ ((((int64_t)(v^(1ULL<<63)))>> 63)|(1ULL<<63)); \
|
||||
}\
|
||||
break;\
|
||||
}\
|
||||
|
|
|
|||
|
|
@ -2989,7 +2989,8 @@ grn_select(grn_ctx *ctx, grn_select_data *data)
|
|||
char *cp = cache_key;
|
||||
|
||||
#define PUT_CACHE_KEY(string) \
|
||||
grn_memcpy(cp, (string).value, (string).length); \
|
||||
if ((string).value) \
|
||||
grn_memcpy(cp, (string).value, (string).length); \
|
||||
cp += (string).length; \
|
||||
*cp++ = '\0'
|
||||
|
||||
|
|
|
|||
5
storage/mroonga/vendor/groonga/lib/str.c
vendored
5
storage/mroonga/vendor/groonga/lib/str.c
vendored
|
|
@ -46,7 +46,7 @@ grn_str_charlen_utf8(grn_ctx *ctx, const unsigned char *str, const unsigned char
|
|||
if (*str & 0x80) {
|
||||
int i;
|
||||
int len;
|
||||
GRN_BIT_SCAN_REV(~(*str << 24), len);
|
||||
GRN_BIT_SCAN_REV(~(((uint) *str) << 24), len);
|
||||
len = 31 - len;
|
||||
if ((unsigned int)(len - 2) >= 3) { /* (len == 1 || len >= 5) */
|
||||
GRN_LOG(ctx, GRN_LOG_WARNING,
|
||||
|
|
@ -1963,7 +1963,8 @@ grn_bulk_write(grn_ctx *ctx, grn_obj *buf, const char *str, unsigned int len)
|
|||
if ((rc = grn_bulk_resize(ctx, buf, GRN_BULK_VSIZE(buf) + len))) { return rc; }
|
||||
}
|
||||
curr = GRN_BULK_CURR(buf);
|
||||
grn_memcpy(curr, str, len);
|
||||
if (str)
|
||||
grn_memcpy(curr, str, len);
|
||||
GRN_BULK_INCR_LEN(buf, len);
|
||||
return rc;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue