MXS-2238: Fix reading of large Avro schemas

The schemas were read incorrectly which resulted in large schemas having
multiple newlines in them.
This commit is contained in:
Markus Mäkelä
2019-01-04 10:20:30 +02:00
parent 7b6ae4bc13
commit 46bea87ff6

View File

@ -853,8 +853,6 @@ GWBUF* read_avro_json_schema(const char *avrofile, const char* dir)
nread--; nread--;
} }
buffer[nread++] = '\n';
GWBUF* newbuf = gwbuf_alloc_and_load(nread, buffer); GWBUF* newbuf = gwbuf_alloc_and_load(nread, buffer);
if (newbuf) if (newbuf)
@ -863,6 +861,8 @@ GWBUF* read_avro_json_schema(const char *avrofile, const char* dir)
} }
} }
rval = gwbuf_append(rval, gwbuf_alloc_and_load(1, "\n"));
fclose(file); fclose(file);
} }
else else