1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

backport to 5.5 dyncol changes and names support

This commit is contained in:
unknown
2012-12-23 20:57:54 +02:00
parent 28c9e1a550
commit 40ae63dd65
19 changed files with 1428 additions and 782 deletions

View File

@ -176,18 +176,19 @@ my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...)
}
my_bool dynstr_append_quoted(DYNAMIC_STRING *str,
const char *append, size_t len)
const char *append, size_t len,
char quote)
{
uint additional= (str->alloc_increment ? str->alloc_increment : 10);
uint lim= additional;
uint i;
if (dynstr_realloc(str, len + additional + 2))
return TRUE;
str->str[str->length++]= '"';
str->str[str->length++]= quote;
for (i= 0; i < len; i++)
{
register char c= append[i];
if (c == '"' || c == '\\')
if (c == quote || c == '\\')
{
if (!lim)
{
@ -200,10 +201,11 @@ my_bool dynstr_append_quoted(DYNAMIC_STRING *str,
}
str->str[str->length++]= c;
}
str->str[str->length++]= '"';
str->str[str->length++]= quote;
return FALSE;
}
void dynstr_free(DYNAMIC_STRING *str)
{
my_free(str->str);