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

The regular expression re_table_name used in function sql_utils::table_from_sql cannot match table name with non English characters. #4398

Open
FredBill1 opened this issue Aug 19, 2023 · 0 comments

Comments

@FredBill1
Copy link

I have a postgis table named 注记5. I'm using postgis datasource with parameter:

<Parameter name="table"><![CDATA[注记5]]></Parameter>
<Parameter name="geometry_field"><![CDATA[]]></Parameter>

Ideally, the geometry_field can be automatically selected from geometry_columns table with the corrent table parameter, but the setting above only works in the previous mapnik versions.

I have noticed this API changes between v3.0 and v3.1, which says:

PostGIS & PGraster: The table/geometry_table/raster_table parameter in XML style must be quoted if it would need quoting in SQL query

But when using postgis outside of mapnik, I do not need to add quotes for the non English characters in query statements.

The current version of sql_utils::table_from_sql (source) uses the regular expression re_table_name (source) to match the table and schema name:

\s*
(\w+|("[^"]*")+)
(\.(\w+|("[^"]*")+))?
\s*

where \w only matches [A-Z a-z 0-9_]. I have to either add quotes, manually set geometry_field parameter, or revert back to use the old version of the function sql_utils::table_from_sql.

Is this the expected behaviour?

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