Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changefeedccl: fix bug with avro encoding and zero-scale decimal cols
This patch fixes a bug where creating a changefeed that targeted tables with a `DECIMAL(n)` column (i.e. zero-scale `DECIMAL` column), `format='avro'`, and `diff` would cause a panic. The cause of this panic was the fact that the third-party `goavro` library we use expected the JSON encoding of the schema to have a numeric `scale` field for decimal types, but we omitted this field whenever it was zero (using `omitempty`), which led to a runtime type assertion failure. We've updated the field to a pointer type in our type definition so that we can distinguish between an unset value and a zero value. Release note (enterprise change): Fixed a bug where creating a changefeed that targeted tables with a `DECIMAL(n)` column (i.e. zero-scale `DECIMAL` column), `format='avro'`, and `diff` would cause a panic.
- Loading branch information