45 Commits

Author SHA1 Message Date
Johan Wikman
e1f1d8e58a Merge branch '2.1' into 2.2 2018-02-02 16:05:14 +02:00
Markus Mäkelä
7093a5bdf8 Fix CREATE TABLE tokenization
The token skipping function did not check for a period or an opening
parenthesis when parsing the test. Also fixed a debug assertion when only
NULL values were inserted.
2018-02-02 12:24:26 +02:00
Markus Mäkelä
3dfb972d87 Merge branch '2.1' into 2.2 2018-01-30 16:28:11 +02:00
Markus Mäkelä
6dcc71d862 MXS-1621: Fix minor bugs caused by previous changes
Used the correct value in table_create_alloc and remove unused
parameter. Use the pre-calculated end pointer when looking for events.
Always use the column count of the TABLE_MAP event as all mismatches are
detected earlier.
2018-01-30 15:59:06 +02:00
Markus Mäkelä
93923acafb MXS-1621: Skip unneeded ALTER TABLE operations
Some ALTER TABLE operations (e.g. ADD INDEX) are not useful to the
avrorouter. These need to be detected and skipped.
2018-01-30 15:59:05 +02:00
Markus Mäkelä
9146a215f7 Fix DDL table identifier parsing
The parsing was inadequate and did not support all forms of quoted
identifiers.
2018-01-30 15:59:05 +02:00
Markus Mäkelä
c000b3186c MXS-1575: Fix optional COLUMN keywork handling
The COLUMN keyword is optional and cannot be assumed to exist.
2018-01-30 15:59:05 +02:00
Markus Mäkelä
8dfb1d0113 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.
2018-01-30 15:59:05 +02:00
Markus Mäkelä
0afe10ffb9 Merge branch '2.1' into 2.2 2018-01-16 09:47:49 +02:00
Markus Mäkelä
9ca6d586d1 MXS-1575: Fix Avro schema versioning
The versions were not updated if the table was dropped and created again.
2018-01-15 16:15:20 +02:00
Markus Mäkelä
5e4b7ae7c7 Fix memory leak in avrorouter
The TABLE_MAP freeing function leaked memory.
2018-01-15 16:15:20 +02:00
Markus Mäkelä
f2771d5ad8 Remove obsolete message
The warning that a schema already exists is obsolete as mapped tables are
now always opened instead of being reused. This causes the schema checks
to be done for each mapped table.
2018-01-15 16:15:19 +02:00
Markus Mäkelä
ce1c45828a MXS-1575: Fix CREATE TABLE processing
The CREATE TABLE processing failed to identify the explicit database names
that were generated by mysqldump.
2018-01-05 12:50:39 +02:00
Markus Mäkelä
7d8905d91f Merge branch '2.1' into 2.2 2018-01-03 14:05:31 +02:00
Markus Mäkelä
a86b81824f MXS-1575: Add extra debug assertions
Added more debug assertions to JSON serialization of the Avro schema. Also
checked that the column count for the TABLE_CREATE object matches that of
the TABLE_MAP object.
2018-01-03 09:44:41 +02:00
Markus Mäkelä
79afaa447e Merge branch '2.1' into 2.2 2017-12-12 13:23:02 +02:00
Markus Mäkelä
8ed1ff67c2 Fix avro regression
The fact whether a query explicitly defined a query was ignored by the
statement parsing function and it always assumed the database was
explicitly defined. This caused the TABLE keyword in a CREATE TABLE
statement to be falsely identified as the current database.
2017-12-07 13:19:06 +02:00
Markus Mäkelä
7c2a173a17 MXS-1536: Always recreate TABLE_MAP objects
When a table map event is read after an alter table, the old TABLE_MAP
object contains old information. Due to this, as well as the added benefit
of making the code easier to read, the recycling of TABLE_MAP objects was
removed. In practice, there were no benefits to re-mapping the tables to a
different ID.
2017-11-30 12:38:43 +02:00
Markus Mäkelä
a32789d4ac MXS-1536: Fix ALTER TABLE parsing
The ALTER TABLE parsing didn't properly handle escaped values and it used
the current database unconditionally.
2017-11-30 12:38:43 +02:00
Markus Mäkelä
0ca04cb5d5 MXS-1536: Fix crash in CREATE TABLE
If a CREATE TABLE statement had a quoted keyword as the name of a field,
the calculated column count and actual column counts would differ.

In addition to this, oneline comments before the end of the statement
would truncate the SQL due to the fact that the whitespace was squashed
before the comment removal was done.
2017-11-30 12:38:43 +02:00
Markus Mäkelä
a971aa25da Merge branch '2.1' into 2.2 2017-10-30 11:01:19 +02:00
Markus Mäkelä
63cbf56cb2 MXS-1500: Fix real_type values
The characters in the type weren't checked for correctness which caused
the processing to read more characters than was intended.
2017-10-30 10:25:03 +02:00
Johan Wikman
02b9e0a01d Merge branch '2.1.7' into develop-2.1-merge 2017-09-12 11:08:02 +03:00
Markus Mäkelä
f98d4c1dbf MXS-1365: Fix buffer reallocation in avrorouter
Buffer size calculation is now done correctly.
2017-08-17 13:39:20 +03:00
Markus Mäkelä
11d494ef33 Fix avro CREATE TABLE message
The string was assumed to be null-terminated when in reality it was not.
2017-07-04 12:40:22 +03:00
Markus Mäkelä
5ed6483f01 Fix avro CREATE TABLE message
The string was assumed to be null-terminated when in reality it was not.
2017-07-04 12:21:25 +03:00
MassimilianoPinto
cb57e10761 Develop merge
Develop merge
2017-06-29 15:34:22 +02:00
Markus Mäkelä
40b1739249 MXS-1299: Fix CREATE TABLE t1 LIKE t2 processing
The creation of tables from other tables was not working even though the
information was available inside the avrorouter.
2017-06-28 11:25:57 +03:00
Markus Mäkelä
17c0bf7dec Merge branch '2.1' into develop 2017-06-14 13:59:18 +03:00
Markus Mäkelä
4c9fc1a39e Merge branch '2.0' into 2.1 2017-06-14 13:36:40 +03:00
Markus Mäkelä
457fc80647 Merge branch '2.1' into develop 2017-06-05 13:25:27 +03:00
Markus Mäkelä
4c78e2c99a Fix avrorouter memory leaks
The loading of the JSON schemas leaked memory as functions that increment
the reference count were used.
2017-06-05 13:20:14 +03:00
Markus Mäkelä
285598e0e5 Fix avrorouter type and name handling
The type and name parsing functions could move outside of allocated memory
as they didn't check for the terminating null character. Also fixed the
printf format string used when the list of used tables is being created.

Fixed CDC testing connector to abort on error and added some extra output
to the cdc_datatypes test.
2017-06-05 13:19:47 +03:00
Johan Wikman
f546a17e77 Update change date of 2.2 2017-06-01 10:24:20 +03:00
Markus Mäkelä
b5d1504e6a Merge branch '2.0' into 2.1 2017-05-26 15:22:43 +03:00
Markus Mäkelä
ed653ac729 Merge branch '2.0' into 2.1-merge-2.0 2017-05-14 10:25:12 +03:00
Markus Mäkelä
8e2c7fd952 Merge branch '2.0' into 2.1 2017-05-10 09:12:42 +03:00
Markus Mäkelä
789c14197d Merge branch '2.0' into 2.1 2017-03-02 14:05:42 +02:00
Johan Wikman
5648f708af Update license to BSL 1.1 2017-02-14 21:42:28 +02:00
Markus Mäkelä
67888f3596 Merge branch '2.0' into 2.1.0 2017-02-08 09:27:00 +02:00
Markus Mäkelä
a48be9badf Format router modules
Formatted router modules with Astyle.
2017-01-17 14:48:43 +02:00
Markus Mäkelä
2cabcea211 Add definitions of MXS_MODULE_NAME to all modules
All modules now declare a name for the module. This is name is added as a
prefix to all messages logged by a module. The prefix should help
determine which part of the system logs a message.
2017-01-16 11:28:34 +02:00
Johan Wikman
b40872e600 Prefix le[int|str]-functions with "mxs_" 2016-12-29 10:10:11 +02:00
Markus Mäkelä
269a97b2de Fix DECIMAL handling in Avrorouter
The DECIMAL value type is now properly handled in Avrorouter. It is
processed into an Avro double value when before it was ignored and
replaced with a zero integer.
2016-12-19 10:33:55 +02:00
Johan Wikman
aef6c7b099 Make directory name equal to the library name
* avro -> avrorouter
* binlog -> binlogrouter
2016-12-01 15:23:42 +02:00