diff options
Diffstat (limited to 'innobase/pars')
-rw-r--r-- | innobase/pars/lexyy.c | 18 | ||||
-rw-r--r-- | innobase/pars/pars0lex.l | 18 | ||||
-rw-r--r-- | innobase/pars/pars0opt.c | 2 |
3 files changed, 18 insertions, 20 deletions
diff --git a/innobase/pars/lexyy.c b/innobase/pars/lexyy.c index 1b8c69ccc7a..d98d3c9b945 100644 --- a/innobase/pars/lexyy.c +++ b/innobase/pars/lexyy.c @@ -636,9 +636,9 @@ Linux. #include "mem0mem.h" #include "os0proc.h" -#define malloc(A) mem_alloc(A) -#define free(A) mem_free(A) -#define realloc(P, A) mem_realloc(P, A, __FILE__, __LINE__) +#define malloc(A) ut_malloc(A) +#define free(A) ut_free(A) +#define realloc(P, A) ut_realloc(P, A) #define exit(A) ut_error #define YY_INPUT(buf, result, max_size) pars_get_lex_chars(buf, &result, max_size) @@ -655,16 +655,16 @@ string_append( const char* str, /* in: string to be appended */ ulint len) /* in: length of the string */ { + if (stringbuf == NULL) { + stringbuf = malloc(1); + stringbuf_len_alloc = 1; + } + if (stringbuf_len + len > stringbuf_len_alloc) { - if (stringbuf_len_alloc == 0) { - stringbuf_len_alloc++; - } while (stringbuf_len + len > stringbuf_len_alloc) { stringbuf_len_alloc <<= 1; } - stringbuf = stringbuf - ? realloc(stringbuf, stringbuf_len_alloc) - : malloc(stringbuf_len_alloc); + stringbuf = realloc(stringbuf, stringbuf_len_alloc); } memcpy(stringbuf + stringbuf_len, str, len); diff --git a/innobase/pars/pars0lex.l b/innobase/pars/pars0lex.l index 0b1af554bed..4e2399613cb 100644 --- a/innobase/pars/pars0lex.l +++ b/innobase/pars/pars0lex.l @@ -58,9 +58,9 @@ Linux. #include "mem0mem.h" #include "os0proc.h" -#define malloc(A) mem_alloc(A) -#define free(A) mem_free(A) -#define realloc(P, A) mem_realloc(P, A, __FILE__, __LINE__) +#define malloc(A) ut_malloc(A) +#define free(A) ut_free(A) +#define realloc(P, A) ut_realloc(P, A) #define exit(A) ut_error #define YY_INPUT(buf, result, max_size) pars_get_lex_chars(buf, &result, max_size) @@ -77,16 +77,16 @@ string_append( const char* str, /* in: string to be appended */ ulint len) /* in: length of the string */ { + if (stringbuf == NULL) { + stringbuf = malloc(1); + stringbuf_len_alloc = 1; + } + if (stringbuf_len + len > stringbuf_len_alloc) { - if (stringbuf_len_alloc == 0) { - stringbuf_len_alloc++; - } while (stringbuf_len + len > stringbuf_len_alloc) { stringbuf_len_alloc <<= 1; } - stringbuf = stringbuf - ? realloc(stringbuf, stringbuf_len_alloc) - : malloc(stringbuf_len_alloc); + stringbuf = realloc(stringbuf, stringbuf_len_alloc); } memcpy(stringbuf + stringbuf_len, str, len); diff --git a/innobase/pars/pars0opt.c b/innobase/pars/pars0opt.c index 4fb0c937f1e..7ba4af15243 100644 --- a/innobase/pars/pars0opt.c +++ b/innobase/pars/pars0opt.c @@ -1190,7 +1190,6 @@ opt_search_plan( #endif } -#ifdef UNIV_SQL_DEBUG /************************************************************************ Prints info of a query plan. */ @@ -1237,4 +1236,3 @@ opt_print_query_plan( (unsigned long) UT_LIST_GET_LEN(plan->end_conds)); } } -#endif /* UNIV_SQL_DEBUG */ |