diff --git a/packages/nocodb/src/db/conditionV2.ts b/packages/nocodb/src/db/conditionV2.ts index 746b3fcbe8..7aa5285080 100644 --- a/packages/nocodb/src/db/conditionV2.ts +++ b/packages/nocodb/src/db/conditionV2.ts @@ -927,7 +927,14 @@ const parseConditionV2 = async ( { // Condition for filter, without negation const condition = (builder: Knex.QueryBuilder) => { - const items = val?.split(',').map((item) => item.trim()); + let items = val?.split(','); + // remove trailing space if database is MySQL and datatype is enum/set + if ( + ['mysql2', 'mysql'].includes(knex.clientType()) && + ['enum', 'set'].includes(column.dt?.toLowerCase()) + ) { + items = items.map((item) => item.trimEnd()); + } for (let i = 0; i < items?.length; i++) { let sql; const bindings = [field, `%,${items[i]},%`];