-
Notifications
You must be signed in to change notification settings - Fork 397
Open
Labels
api: spannerIssues related to the Spanner API.Issues related to the Spanner API.priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
Environment details
- OS: Windows
- .NET version: 8
- Package name and version: Google.Cloud.Spanner.Data 5.1.0
Steps to reproduce
- Create a table with a column using a protobuf enum data type
syntax = "proto2";
package mycompany.enums;
enum Product {
PRODUCT1 = 0;
PRODUCT2 = 1;
}
CREATE TABLE Orders (
OrderId STRING(16) NOT NULL,
Product mycompany.enums.Product,
)
PRIMARY KEY (OrderId)
- Reading from the table using SpannerDataReader results in a NullReferenceException calling
GetValueon theProductcolumn. The only method that seems to work for the column isGetJsonValue.
Points to note
- This issue was found using the spanner emulator.
- Comparing the metadata SpannerDataReader holds for the affected column
{ "name": "Product", "type": { "code": "ENUM", "protoTypeFqn": "mycompany.enums.Product" } }and the code for SpannerDbType.FromProtobufType, it looks like the code does not handle the enum type.
Metadata
Metadata
Assignees
Labels
api: spannerIssues related to the Spanner API.Issues related to the Spanner API.priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.