Commit f10df51
committed
[KYUUBI #7305][FOLLOWUP] Skip Hive protocol "default" stub in session open
The Hive JDBC driver sends `USE_DATABASE = "default"` when the user did not
specify a database in the connection URL — a protocol-level stub
indistinguishable from a genuine request for a database literally named
"default". Forwarding that into `setSchema` plus recording it as
`effectiveDatabase` caused PG and ClickHouse metadata operations to scope to
a non-existent or unintended schema, breaking the existing
`get tables` suites in CI.
Filter `"default"` at the session entry point: skip both the dialect
`setSchema` call and the `effectiveDatabase` assignment for it. Drops the
prior try/catch that only existed to tolerate the failure path. Also rewords
the in-tree `MySQLDialect.setSchema` comment to describe the externally
observed behavior of the documented `databaseTerm` connection property,
without paraphrasing driver internals.
URL paths that name a real non-`default` database keep the new scoping
behavior; URL paths that explicitly name `default` continue to behave as
before this PR (no metadata scope), which is the same as URL paths with no
database — there is no observable regression.1 parent a487d97 commit f10df51
2 files changed
Lines changed: 17 additions & 19 deletions
File tree
- externals/kyuubi-jdbc-engine/src/main/scala/org/apache/kyuubi/engine/jdbc
- dialect
- session
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
| |||
Lines changed: 11 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
53 | | - | |
54 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
91 | 88 | | |
92 | 89 | | |
93 | 90 | | |
| |||
0 commit comments