Commit d245edc
authored
Fix NPE in table model export when -q is not specified (#17462)
When using export-data with table model (sql_dialect=table) and only
specifying -db without -q, queryCommand is null. The original condition
`sqlDialectTree && queryCommand == null` only handled the tree model
case, causing the else branch to call `queryCommand.trim().split(";")`
which throws NullPointerException.
Restructure the branch logic to check `queryCommand == null` first:
- Tree model + no query: interactive SQL input (unchanged)
- Table model + no query: call exportBySql(null, 0) to auto-generate
"select * from <table>" for all tables, which also correctly applies
start_time/end_time filters
- Query provided: split by semicolon for multi-statement support (unchanged)1 parent 1c1cbca commit d245edc
1 file changed
Lines changed: 16 additions & 12 deletions
Lines changed: 16 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
239 | 243 | | |
240 | 244 | | |
241 | 245 | | |
| |||
0 commit comments