Incorrect list of columns for table containing underscore
See original GitHub issueSystem information:
- Operating system (distribution) and version: both Windows and Linux
- DBeaver version: 7.2.2 (issue present in previous versions too)
- Additional extensions: none
Connection specification:
- Database name and version: SAP HANA (both 2.0 and HANA Cloud)
- Driver name: maven:/com.sap.cloud.db.jdbc:ngdbc, versions 2.4, 2.5, 2.6
- Do you use tunnels or proxies (SSH, SOCKS, etc)? no
Describe the problem you’re observing:
A table with the name containing an underscore will display an incorrect list of columns, if there is another table with a letter instead of the underscore in the name.
Steps to reproduce, if exist:
- Create two tables,
ABC
andA_C
. - Double click on
A_C
, go to Properties, then Columns. You will see the columns from both tables, first the ones fromABC
and then the ones fromA_C
.
The reason most likely is that underscore matches any letter in the SQL LIKE
predicate:
https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.05/en-US/20fa17f375191014a4d8d8cbfddfe340.html
If this is the case, other databases might also be affected, as this is not HANA-specific - it is also specified in the ANSI SQL standard. In general, a check for equality should be done using the =
operator instead, while LIKE
should be used for pattern matching only.
Include any warning/errors/backtraces from the logs
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (9 by maintainers)
Top Results From Across the Web
JPA column with incorrect underscore - java - Stack Overflow
For me, my cameCase properties in my entity class were automatically getting generated to snake case columns of defined properties in DB table....
Read more >How to work around Table and/or field names contain ...
There are two ways to workaround this and reference a table or field name that contains dashes/hyphens or starts with an underscore character....
Read more >Invalid Column Name SQL: How to Use Columns Properly
Valid Table Name Rules in SQL. A valid SQL name for columns, tables, and databases must follow the rules below: Names must begin...
Read more >ConvertJSONToSQL - Ignores underscore in update keys
Anybody has answer for this- I get this issue on PutDatabaseRecord as well. When I check java code of PutDatabaseRecord.
Read more >Importing csv Table with Underscores - LaTeX Stack Exchange
Apparently it doesn't like being inside a table. Try \csvreader[longtable={|l|l|},table head=\hline,respect underscore=true,head to column names ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
the internal statement for
DatabaseMetaData#getColumns
containsso \ is the escape character
Of course would be better if the JDBC driver would provide this option but this will take some time. Many JDBC drivers are incomplete so dbeaver has various places to compensate for missing properties like SQLDialect classes and driver plugin.xml