1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

cleanup: generate_partition_syntax()

Don't write to a temporary file, use String.
Remove strange one-liner "helpers", use String methods.
Don't use current_thd, don't allocate memory for 1-byte strings, etc.
This commit is contained in:
Sergei Golubchik
2017-06-28 12:50:18 +02:00
parent 03c52e964f
commit 504eff0ca1
10 changed files with 168 additions and 449 deletions

View File

@ -480,6 +480,14 @@ bool String::append(const char *s)
return append(s, (uint) strlen(s));
}
bool String::append_longlong(longlong val)
{
if (realloc(str_length+MAX_BIGINT_WIDTH+2))
return TRUE;
char *end= (char*) longlong10_to_str(val, (char*) Ptr + str_length, -10);
str_length= end - Ptr;
return FALSE;
}
bool String::append_ulonglong(ulonglong val)