Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4D Mobile] Semi-colon in query string value returns error from 4D #275

Open
liuxiang625 opened this issue Mar 25, 2019 · 0 comments
Open

Comments

@liuxiang625
Copy link

Systems or/and 4D versions and build number or/and hardware where the bug happens:
- Mac and Windows
- 32 and 64 Bit
- v17.1 and v17R5 (main 235244)
- Wakanda Enterprise 2.7.0

SUMMARY:

When a query value contains a semicolon ";" in the query value, Wakanda query() method to 4D database via 4D Mobile returns a "datastore class cannot be found" error with error code 1800. For example, the following query:

ds.Person.query('FirstName=:1',"John;")
and
ds.Person.query("FirstName=John;")
Will both return the following error:

{
	"__ERROR": [
		{
			"message": "Error code: 1800 (dbmg)\nThe \"Person;\",\"diacritical\"\" datastore class cannot be found\ncomponent: 'dbmg'\ntask 132111, name: 'HTTP connection handler'\n",
			"componentSignature": "dbmg",
			"errCode": 1800
		},
		{
			"message": "Error evaluating javascript file:///Users/xliu/Documents/Wakanda/solutions/V17SemiColonQuery/backend/query.js",
			"componentSignature": "JS4D",
			"errCode": 2
		}
	]
}

Steps to reproduce with Wakanda:

  1. Open Sample database
  2. Open Sample Wakanda solution in Wakanda studio 2.7.0
  3. Open Query.js, click run

EXPECTED RESULT:
Query method will return an entity collection

ACTUAL RESULT:
Query receives an "datastore class cannot be found" error from 4D, see sreenshot below:
Screen Shot 2019-03-25 at 4 40 54 PM

Tech support notes:

Below is the requires logged for the query with a semicolon: ds.Person.query('FirstName=:1',"John;")

127.0.0.1 - - [25/Mar/2019:23:22:15 -429496728900] "GET /rest/Person;%22,%22diacritical%22:false%7D%5D%7D'&$top=80?$method=entityset&$query='%7B%22model%22:%22Person%22,%22queryItems%22:%5B%7B%22tokenType%22:%22simpleCompWithEm%22,%22attName%22:%22FirstName%22,%22emName%22:%22Person%22,%22comparaison%22:13,%22instance%22:0,%22checkForNull%22:false,%22value%22:%22John HTTP/1.1" 404 228
Below is the requires logged for the query with a semicolon: ds.Person.query('FirstName=:1',"John")

127.0.0.1 - - [25/Mar/2019:23:22:22 -429496728900] "GET /rest/Person?$method=entityset&$query='%7B%22model%22:%22Person%22,%22queryItems%22:%5B%7B%22tokenType%22:%22simpleCompWithEm%22,%22attName%22:%22FirstName%22,%22emName%22:%22Person%22,%22comparaison%22:13,%22instance%22:0,%22checkForNull%22:false,%22value%22:%22John%22,%22diacritical%22:false%7D%5D%7D'&$top=80 HTTP/1.1" 200 242

It appears when Wakanda parses the semicolon as part of the dataclass name instead of the query value when sending the request to 4D.

The semicolon query works without error in Local model.

Sample 4D database and Wakanda solution attached:
V17SemiColonQuery.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant