Start a new topic

underscores being escaped differently?

[This topic is migrated from our old forums. The original author name has been removed]

hi guys, seems hard to believe DbVis is doing this rather than the jdbc driver but the only thing i changed was upgrading from DbVis 9.2.5 to 9.2.7 and this happens. * in this query: {noformat} SELECT table_catalog AS TABLE_CAT, table_schema AS TABLE_SCHEM, table_name AS TABLE_NAME, table_type AS TABLE_TYPE, '' AS REMARKS, '' AS TYPE_CAT, '' AS TYPE_SCHEM, '' AS TYPE_NAME, '' AS SELF_REFERENCING_COL_NAME, '' AS REF_GENERATION FROM information_schema.tables WHERE table_catalog = 'hive' AND table_schema LIKE 'bi\_staging' AND table_name LIKE '%' AND table_type in ('BASE TABLE') ORDER BY TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME {noformat} * you'll see the clause: AND table_schema LIKE 'bi\_staging' that backslash that is supposedly escaping the '_' is killing me. This does not occur on DbVis 9.2.5. Is this something DbVis controls? or is this something the JDBC driver authors control? Given the only thing i changed was the DbVis version i'm personally leaning towards the former. Thanks for any pointers and apologies if this is a really dumb question. thanks, Stephen.

[This reply is migrated from our old forums.]

Re: underscores being escaped differently?
Stephen, Which database and driver are you using? Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]

Re: underscores being escaped differently?
Hi Roger, I'm using DbVis to connect to a Hadoop datasource - so not a built-in one packaged with DbVis. In my case its called 'Presto' which is developed at Facebook. The jdbc driver can be located here: https://prestodb.io/docs/current/installation/jdbc.html I stress again that it works fine with DbVis 9.2.5 but inserts that backslash in DbVis 9.2.7. The 'it' part is what is unclear to me. What bit of code is controlling that? :) Thanks for your help! Cheers, Stephen.
[This reply is migrated from our old forums.]

Re: underscores being escaped differently?
Stephen, Thanks for the info. In 9.2.7 we introduced so that DbVisualizer respects the JDBC driver in terms of escaping _ and % in certain driver calls. Some driver vendors have missed to fully support this and what you experience is one of those drivers. In the upcoming 9.2.8 version we will revert so that all non supported drivers/databases will ignore escaping to prevent these kinds of situations. The workaround until 9.2.8 is that you open DBVIS-HOME\resources\dbvis-custom.prefs in a text editor and add the following on a new line: dbvis.generic.ProcessSearchStringEscape=false Then re-start DbVisualizer and give it a try. Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]

Re: underscores being escaped differently?
Hi Roger, Superb! Thanks so much for this. I will give it shot and let you know how it goes. I can also inform the FB developers who author the JDBC driver to consider reviewing the JDBC specs about "escaping" You definitely feel this is spec'd out the JDBC Driver doc, eh? :) Cheers, STephen.
[This reply is migrated from our old forums.]

Re: underscores being escaped differently?
HI Stephen, Great! This might be useful sharing with the developers: It is the DatabaseMetaData.getSearchStringEscape() method that returns '\' while various methods returning ResultSet's (such as getTables(), getColumns(), etc) doesn't honor it nor escape any _ or % with it. I hope this is of any help. Regards Roger
[This reply is migrated from our old forums.]

Re: underscores being escaped differently?
Stephen, Just to inform you 9.2.8 is now released and the fix I previously posted is not required any more as it is the default. Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]

Re: underscores being escaped differently?
Hi Stephen, I am trying to connect to Presto using DBVis (V9.2.12). I downloaded the presto-jdbc-0.123.jar from https://prestodb.io/docs/current/installation/jdbc.html and tried to add a driver but it did not come up with any driver class. It seems that you have already managed to connect to Presto from DBVis. Can you please help? Thanks, Sudipta