MXS-1621: Add ALTER TABLE ... [FIRST | AFTER col ] parsing

The parser checks whether the FIRST or AFTER keywords are used and, if
AFTER is used, extracts the relevant column name.

Added a test case that checks that the parsing works and detects the
correct column names.
This commit is contained in:
Markus Mäkelä
2018-01-25 11:39:03 +02:00
parent f9cc2d5bbb
commit 8dfb1d0113
5 changed files with 212 additions and 2 deletions

View File

@ -1040,12 +1040,13 @@ void handle_query_event(AVRO_INSTANCE *router, REP_HEADER *hdr, int *pending_tra
db[dblen] = 0;
size_t sqlsz = len, tmpsz = len;
char *tmp = MXS_MALLOC(len);
char *tmp = MXS_MALLOC(len + 1);
MXS_ABORT_IF_NULL(tmp);
remove_mysql_comments((const char**)&sql, &sqlsz, &tmp, &tmpsz);
sql = tmp;
len = tmpsz;
unify_whitespace(sql, len);
sql[len] = '\0';
static bool warn_not_row_format = true;