Fix field name parsing
The fix to field name parsing didn't properly break the loop when the backtick character was detected.
This commit is contained in:
@ -451,6 +451,10 @@ static const char *extract_field_name(const char* ptr, char* dest, size_t size)
|
|||||||
while (*ptr && (isspace(*ptr) || (bt = *ptr == '`')))
|
while (*ptr && (isspace(*ptr) || (bt = *ptr == '`')))
|
||||||
{
|
{
|
||||||
ptr++;
|
ptr++;
|
||||||
|
if (bt)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strncasecmp(ptr, "constraint", 10) == 0 || strncasecmp(ptr, "index", 5) == 0 ||
|
if (strncasecmp(ptr, "constraint", 10) == 0 || strncasecmp(ptr, "index", 5) == 0 ||
|
||||||
@ -483,11 +487,6 @@ static const char *extract_field_name(const char* ptr, char* dest, size_t size)
|
|||||||
/** Valid identifier */
|
/** Valid identifier */
|
||||||
size_t bytes = ptr - start;
|
size_t bytes = ptr - start;
|
||||||
|
|
||||||
if (bt)
|
|
||||||
{
|
|
||||||
bytes--;
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(dest, start, bytes);
|
memcpy(dest, start, bytes);
|
||||||
dest[bytes] = '\0';
|
dest[bytes] = '\0';
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user