DB2 - Problem description
Problem IT39268 | Status: Closed |
JSON WIRE LISTENER FAILS WHEN REGEX IS USED IN FIND COMMAND | |
product: | |
DB2 CONNECT / DB2CONNCT / B50 - DB2 | |
Problem description: | |
IBM NoSQL/JSON Wire Listener fails to execute find command from mongo clients and returns run time exception when find command has "$regex" as a filter condition in find() command like below: An exception has been thrown: Wire Listener Failed in Finding Document: {"find":"MapicsGroup","filter":{"$or":[{"createdByUserId":{"$reg ex":"TestReq5","$options":"i"}},{"approvals.approverLevels.appro vers.approverId":"$regex":"TestReq5","$options":"i"}}]},"sort":{ "_id":-1},"$db":"MAPICS"} com.ibm.nosql.json.api.DBException : [nosql][1.4.250] An unexpected token "," was found following "UE AS VARCHAR(2048))". Expected tokens may include: "LIMIT".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.29.24; The problem is with Db2 NoSQL Java Driver which is used by wire listener internally. The find command is unable to handle the regex filters. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * When IBM NoSQL Command line tool or IBM JSON Wire listener * * is used to run a find() command having more than one $regex * * as a filter condition. * **************************************************************** * PROBLEM DESCRIPTION: * * IBM NoSQL/JSON Wire Listener fails to execute find command * * from mongo clients and returns run time exception when find * * command has "$regex" as a filter condition with $or * * condition in find() command like below: * * * * An exception has been thrown: Wire Listener Failed in * * Finding Document: * * {"find":"MapicsGroup","filter":{"$or":[{"createdByUserId":{" * * $regex":"TestReq5","$options":"i"}},{"approvals.approverLeve * * ls.approvers.approverId":"$regex":"TestReq5","$options":"i"} * * }]},"sort":{"_id":-1},"$db":"MAPICS"} * * * * com.ibm.nosql.json.api.DBException : [nosql][1.4.250] An * * unexpected token "," was found following "UE AS * * VARCHAR(2048))". * * Expected tokens may include: "LIMIT".. SQLCODE=-104, * * SQLSTATE=42601, DRIVER=4.29.24; * **************************************************************** * RECOMMENDATION: * * Upgrade to Db2 version 11.5.7.1 or later releases. * **************************************************************** | |
Local Fix: | |
Solution | |
Workaround | |
**************************************************************** * USERS AFFECTED: * * When IBM NoSQL Command line tool or IBM JSON Wire listener * * is used to run a find() command having more than one $regex * * as a filter condition. * **************************************************************** * PROBLEM DESCRIPTION: * * IBM NoSQL/JSON Wire Listener fails to execute find command * * from mongo clients and returns run time exception when find * * command has "$regex" as a filter condition with $or * * condition in find() command like below: * * * * An exception has been thrown: Wire Listener Failed in * * Finding Document: * * {"find":"MapicsGroup","filter":{"$or":[{"createdByUserId":{" * * $regex":"TestReq5","$options":"i"}},{"approvals.approverLeve * * ls.approvers.approverId":"$regex":"TestReq5","$options":"i"} * * }]},"sort":{"_id":-1},"$db":"MAPICS"} * * * * com.ibm.nosql.json.api.DBException : [nosql][1.4.250] An * * unexpected token "," was found following "UE AS * * VARCHAR(2048))". * * Expected tokens may include: "LIMIT".. SQLCODE=-104, * * SQLSTATE=42601, DRIVER=4.29.24; * **************************************************************** * RECOMMENDATION: * * Upgrade to Db2 version 11.5.7.1 or later releases. * **************************************************************** | |
Comment | |
db2_v11571 contains fix of this issue. After fix, find() command with multiple $regex filters works fine without any error. | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 30.11.2021 15.12.2021 24.10.2022 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) |