5834 Commits

Author SHA1 Message Date
Markus Mäkelä
5a0d2c54bd MXS-1216: Fix DATETIME(n) value interpretation
The DATETIME(n) values generated by a MariaDB 10.0 server were not
interpreted correctly as the wrong algorithm was used to extract the
values.

DATETIME(0) values still do not work properly and they require further
debugging and changes to the code.
2017-05-15 10:25:12 +03:00
Markus Mäkelä
a12d19591e MXS-1216: Store field real type and length in Avro schema
The avro schema allows custom properties to be defined for the schema
fields. The avrorouter stored extra information about the table into the
schema for later use.

Currently, this information is only generated by the avrorouter
itself. Further improvements to the schema generator scripts need to be
done.
2017-05-15 10:25:12 +03:00
Markus Mäkelä
6b6a7fa4a1 Do checkpoint processing at end of binlog
When the binlog has been read, it needs to be treated as if the
transaction or row limit has been hit. This will cause all tables to be
flushed to disk before the files are indexed.
2017-05-15 10:25:11 +03:00
Markus Mäkelä
8a288110a9 Rename conflicting Avro fields
When a user defined field conflicts with an internal MaxScale field, the
field is suffixed with an underscore.
2017-05-15 10:25:11 +03:00
Markus Mäkelä
926930e241 MXS-1216: Correct CHAR(n) handling
The field length was wrongly compared to less than 255 for two byte field
lengths. In addition to that, the metadata was interpreted in the wrong
way.
2017-05-15 10:25:09 +03:00
Markus Mäkelä
c988735a03 MXS-1216: Fix crash on MariaDB 10.0 DATETIME(n)
When a MariaDB 10.0 DATETIME field with a custom length was defined, the
field offsets weren't calculated properly.

As there is no metadata for pre-10.1 DATETIME types with decimal
precision, the metadata (i.e. decimal count) needs to be gathered from the
CREATE TABLE statement. This information is then used to calculate the
correct field length when the value is decoded.

This change does not fix the incorrect interpretation of the old DATETIME
value. The converted values are still garbled due to the fact that the
value needs to be shifted out of the decimal format before it can be
properly converted.
2017-05-15 10:25:06 +03:00
Markus Mäkelä
898bc3444e MXS-1216: Fix processing of long fixed strings
The fixed length string processing assumed that the string lengths were
contained in the first byte. This is not true for large fixed length
strings that take more than 255 bytes to store. This consists of
multi-byte character strings that can take up to 1024 bytes to store.
2017-05-09 14:46:39 +03:00
MassimilianoPinto
ade2cef852 MXS-1244: added 'detect_stale_slave' in monitor params
'detect_stale_slave' added to monitor params
2017-04-24 10:34:13 +02:00
MassimilianoPinto
e6b34ea85c Added depth and SERVER_SLAVE_OF_EXTERNAL_MASTER for build_mysql51_replication_tree
Now build_mysql51_replication_tree assigns depth and handles
SERVER_SLAVE_OF_EXTERNAL_MASTER status
2017-04-21 17:09:28 +02:00
MassimilianoPinto
6b9a2cd0b5 MXS-1244: MySQL monitor "detect_replication_lag=true" doesn't work with "mysql51_replication=true"
Added the missing handle->master assignment
2017-04-21 16:11:30 +02:00
Esa Korhonen
a418387d0a MXS-1218 Poll statistics changed to 64bit to avoid looparound
Statistics calculation, printing and MaxInfo are modified.
n_fds remains 32bit.
2017-04-18 13:14:47 +03:00
MassimilianoPinto
496189dd59 MXS-1221: Nagios plugin scripts does not process -S option properly
Nagios plugin scripts does not process -S option properly
2017-04-18 10:18:15 +02:00
Markus Mäkelä
41a9663611 MXS-1191: Fix crash on column drop
When a column is dropped from a table with a schema that has more columns
than the row event has, avrorouter will crash.
2017-04-04 17:08:07 +03:00
Markus Mäkelä
c67894b011 Add Avro schema generator Python script
The script is the Python version of the cdc_schema.go application.
2017-04-04 16:42:39 +03:00
Johan Wikman
cda5bb7935 Merge branch '2.0.5' into 2.0 2017-04-04 14:32:57 +03:00
Johan Wikman
e1e7137a68 Remove references to old release notes 2017-03-22 12:58:44 +02:00
Markus Mäkelä
7d7d8a0560 Print all output as raw bytes
Printing all output as raw bytes allows MaxScale to control the formatting
process. This also removes the need to convert the bytes to Python strings
and the need to parse the JSON.
2017-03-20 11:10:28 +02:00
Johan Wikman
7c2070171f Merge branch '2.0.5' into 2.0 2017-03-20 09:40:10 +02:00
Johan Wikman
5ea4f44aa2 Remove all but 2.0 release notes from 2.0 branch 2017-03-20 09:29:16 +02:00
Johan Wikman
b24bf7004d Update release notes link 2017-03-14 08:18:13 +02:00
Johan Wikman
c282f7e1a7 Merge branch '2.0.5' into 2.0 2017-03-11 08:10:23 +02:00
Johan Wikman
552ee4ad64 Update release date 2017-03-11 08:04:11 +02:00
Markus Mäkelä
454248e3ec Fix builds with system Connector-C
If the system Connector-C is used, we must generate a fake connector-c
target that the core can depend on.
2017-03-09 20:20:02 +02:00
Markus Mäkelä
20d89717c7 Remove unused headers
The my_config.h headers are not used.
2017-03-09 13:02:23 +02:00
Timofey Turenko
84a6848f10 Add build information to --version-full
If the Jenkins build information is available, print it in the full
version output.
2017-03-09 09:32:37 +02:00
Markus Mäkelä
d764bb9e1f MXS-1178: Fix master_accept_reads
The order of the servers in the service definition could break the
master_accept_reads functionality.

When the first server defined in the service is a slave, it will always be
picked as the first candidate for reads. The master would only be
considered as a candidate for reads if no previous candidate was
available. For this reason, the master_accept_reads only worked when the
first server in the list was the master.
2017-03-09 07:45:29 +02:00
Markus Mäkelä
fd2df3a863 Always open files with configured block size
If the Avro file already exists, it should be opened with the configured
block size instead of the default block size of 16 kilobytes.
2017-03-08 20:03:45 +02:00
Johan Wikman
60c69d0f7f Update change log and release notes for 2.0.5 2017-03-07 10:33:50 +02:00
Johan Wikman
4f8fdca6ae Update version to 2.0.5 2017-03-07 10:33:50 +02:00
Markus Mäkelä
dd07feda07 MXS-1025: Parse SAVEPOINT statements
The various forms of the SAVEPOINT/RELEASE/ROLLBACK statements are now
fully parsed.
2017-03-07 08:44:21 +02:00
Markus Mäkelä
f2fc9b9d9f Add workaround for null value handling in Avro C API
The Avro C API fails to write bytes of size zero. A workaround is to write
a single zero byte for each NULL field of type bytes.

Also added an option to configure the Avro block size in case very large
records are written.
2017-03-04 10:12:18 +02:00
Markus Mäkelä
09df0acb00 Fix binlog rotation detection
The rotations of binlogs weren't detected as the file names weren't
compared.

Moved the indexing of the binlogs to the end of the binlog
processing. This way the files can be flushed multiple times before they
are indexed.
2017-03-04 00:31:07 +02:00
Markus Mäkelä
dadc0d6a9d Fix DATETIME and BLOB processing
The old DATETIME format wasn't processed properly which caused a
corruption of following events.

A BLOB type value could be non-NULL but still have no data. In this case,
the value should be stored as a null Avro value.
2017-03-04 00:26:51 +02:00
Markus Mäkelä
075ca42482 Expand slave_selection_criteria documentation
Added a section about how `slave_selection_criteria` and
`max_slave_connections` affect each other.
2017-03-02 13:33:45 +02:00
Markus Mäkelä
e2869052bd MXS-1081: Fix VARCHAR field processing
The data length is stored in the field metadata instead of the data being
encoded as a length encoded string.
2017-03-02 13:14:07 +02:00
Markus Mäkelä
e01a6a0d58 Fix field name parsing
The fix to field name parsing didn't properly break the loop when the
backtick character was detected.
2017-03-02 13:12:45 +02:00
Markus Mäkelä
e4b4dad94a Add more debug assertions to avro row processing
The debug assertions check that the event pointer isn't moving beyond
allocated memory.
2017-03-02 13:11:52 +02:00
Markus Mäkelä
97115fae6a Fix threads documentation
The description of the `auto` value was wrong. The algorithm is:

    CPU count - 1
2017-03-02 12:21:06 +02:00
Markus Mäkelä
0de9561b5a MXS-1146: Fix command tracking for large packets
The current command was updated with invalid data when the packet size
exceeded 2^24 bytes.
2017-03-02 12:21:05 +02:00
Markus Mäkelä
f7cc548093 Format mysql_binlog.c
The lines were too long.
2017-02-13 16:23:26 +02:00
Markus Mäkelä
7a35ec71da Fix DECIMAL conversion
The DECIMAL type was not correctly converted to positive integers. The
0x80 bit was set only for negative numbers when it needed to be XOR-ed for
all values.
2017-02-13 16:23:26 +02:00
Markus Mäkelä
16ddefc686 Remove DECIMAL from avrorouter limitations
The router can now handle DECIMAL types.

Backported to the 2.0 branch.
2017-02-13 16:23:26 +02:00
Markus Mäkelä
f9732d7041 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.

Backported to the 2.0 branch.
2017-02-13 16:23:26 +02:00
Markus Mäkelä
4bd743d3ce Use correct Avro function
The avrorouter used the 32-bit function to store 64-bit integers. This
caused incorrect values to be stored.
2017-02-13 16:23:26 +02:00
Markus Mäkelä
65caaab77b Fix maxavro block verification errors
An error was logged when the end of file was reached. The error should
only be logged when a partial sync marker is read and the end of file has
not been reached.
2017-02-13 16:23:26 +02:00
Markus Mäkelä
0b892c9714 Add missing newline to avrorouter output
The schema was not terminated with a newline.
2017-02-13 16:23:22 +02:00
Markus Mäkelä
10e74225c0 Add missing error detection
If the file fails to seek to the correct position, the indexing should
stop.
2017-02-13 16:18:43 +02:00
Markus Mäkelä
fb21b99983 Fix DATE and DATETIME months
The month values for DATE and DATETIME were off by one.
2017-02-09 16:50:14 +02:00
Markus Mäkelä
47a1cdad5d Fix binlog integer conversion
The binlog integers were stored as unsigned values instead of signed ones.
2017-02-09 16:01:03 +02:00
Markus Mäkelä
526e48e459 Fix floats being read as doubles
The avro floating point numbers were processed as 8 byte values when they
are 4 bytes values.
2017-02-09 15:00:19 +02:00