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

GeoRaster: Preserve quote in the connection string to the GeoRaster driver so th… #10865

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

fechen123
Copy link
Contributor

…at Oracle Database wallet can be supported.

What does this PR do?

Preserve the quote in the parameter parsing so that Oracle Database connection string with quote can be supported by the GeoRaster driver. This is required when the connection string is like the following:

geor:/@(description=(retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1511)(host=))(connect_data=(service_name=<service_name>))(security=(WALLET_LOCATION=<wallet_location>)(ssl_server_cert_dn="CN=<..>, OU=<...>, O=<...>, L=Redwood Shores, ST=California, C=US")))

Otherwise, the GeoRaster driver will give error:

ERROR 1: ORA-12162: TNS:net service name is incorrectly specified

What are related issues/pull requests?

Tasklist

  • ADD YOUR TASKS HERE
  • Make sure code is correctly formatted (cf pre-commit configuration)
  • Add test case(s)
  • Add documentation
  • Updated Python API documentation (swig/include/python/docs/)
  • Review
  • Adjust for comments
  • All CI builds and checks have passed

Environment

Provide environment details, if relevant:

  • OS:
  • Compiler:

@rouault
Copy link
Member

rouault commented Sep 23, 2024

Linting issues:

 If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
diff --git a/frmts/georaster/georaster_wrapper.cpp b/frmts/georaster/georaster_wrapper.cpp
index d0a6525..6e27120 100644
--- a/frmts/georaster/georaster_wrapper.cpp
+++ b/frmts/georaster/georaster_wrapper.cpp
@@ -214,11 +214,10 @@ char **GeoRasterWrapper::ParseIdentificator(const char *pszStringID)
 
     char *pszStartPos = (char *)strstr(pszStringID, ":") + 1;
 
-    char **papszParam =
-        CSLTokenizeString2(pszStartPos, ",@",
-                           CSLT_HONOURSTRINGS | CSLT_ALLOWEMPTYTOKENS |
-                               CSLT_STRIPLEADSPACES | CSLT_STRIPENDSPACES |
-                               CSLT_PRESERVEQUOTES);
+    char **papszParam = CSLTokenizeString2(
+        pszStartPos, ",@",
+        CSLT_HONOURSTRINGS | CSLT_ALLOWEMPTYTOKENS | CSLT_STRIPLEADSPACES |
+            CSLT_STRIPENDSPACES | CSLT_PRESERVEQUOTES);
 
     //  -------------------------------------------------------------------
     //  The "/" should not be catch on the previous parser

See https://gdal.org/en/latest/development/dev_practices.html#commit-hooks

Fengting Chen added 2 commits September 24, 2024 12:17
@coveralls
Copy link
Collaborator

Coverage Status

coverage: 69.418% (-0.002%) from 69.42%
when pulling a89774a on fechen123:preserve_quote_in_connection
into 6aa2e2e on OSGeo:master.

@rouault rouault merged commit 388d97f into OSGeo:master Sep 24, 2024
37 checks passed
@fechen123 fechen123 deleted the preserve_quote_in_connection branch September 24, 2024 18:58
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

Successfully merging this pull request may close these issues.

3 participants