github-actions[bot] commented on code in PR #68640:
URL: https://github.com/apache/doris/pull/68640#discussion_r4310297233
##########
fe/fe-core/src/main/java/org/apache/doris/qe/MysqlConnectProcessor.java:
##########
@@ -343,7 +343,9 @@ protected void handleFieldList(String tableName) throws
ConnectionException {
table.readLock();
try {
MysqlProtocolAdapter.of(ctx).resultSender(ctx)
- .sendFieldList(db.getFullName(), table.getName(),
table.getBaseSchema());
+ // COM_FIELD_LIST is a metadata statement: it must agree
with SHOW COLUMNS, so it serves
+ // the display schema (the nullability the source
declares), not the read schema.
+ .sendFieldList(db.getFullName(), table.getName(),
table.getBaseSchemaForDisplay());
Review Comment:
[P2] Encode declared nullability in the field-list packets
For an Iceberg column such as `id BIGINT NOT NULL`, this passes a display
column with `isAllowNull() == false`, but `MysqlResultSender.sendFieldList()`
calls `MysqlSerializer.writeField(db, table, column, true)`, whose flags still
come only from `getMysqlFlags(column.getType())`. That method never reads
nullability and emits no `NOT_NULL_FLAG`, so a
`COM_FIELD_LIST`/`mysql_list_fields()` client still sees `id` as nullable while
`SHOW COLUMNS` now reports `NO`. Serialize the display column's nullability
into the field flags on this path, and cover required and optional columns with
a packet-level assertion.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]