Sascha Huk created NIFI-14448:
---------------------------------
Summary: Fix integer serialization to respect SQL UNSIGNED type
semantics
Key: NIFI-14448
URL: https://issues.apache.org/jira/browse/NIFI-14448
Project: Apache NiFi
Issue Type: Bug
Components: Extensions
Affects Versions: 2.3.0
Reporter: Sascha Huk
The processor CaptureChangeMySQL changes the value of larger sql-unsigned
integer values - for example in the following way: UNSIGNED TINYINT 179 gets
thrown on -77.
For more context:
* see the [current Implementation notes of the Shyiko Binlog
Connector|[https://github.com/shyiko/mysql-binlog-connector-java/tree/0.21.0?tab=readme-ov-file#implementation-notes]|https://github.com/shyiko/mysql-binlog-connector-java/tree/0.21.0?tab=readme-ov-file#implementation-notes]:]":
_data of numeric types (tinyint, etc) always returned signed(!) regardless of
whether column definition includes "unsigned" keyword or not._
* There are no unsigned integer types in Java
Therefore, your org.apache.nifi.cdc.event.ColumnDefinition has to memorize
isSigned from java.sql.ResultSetMetaData und use this information for the
correct interpretation of Shyiko's Java integer types, at least during
serialization in your JSON writers.
I will offer a MergeRequest, while preserving the author's design and coding
style as unchanged as possible.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)