Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
07e258a3
Unverified
Commit
07e258a3
authored
4 years ago
by
Jeff Evans
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix issues in execute.clj from follow-up on PR #14883 (#15102)
parent
0ad49a9e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/metabase/driver/sql_jdbc/execute.clj
+6
-7
6 additions, 7 deletions
src/metabase/driver/sql_jdbc/execute.clj
with
6 additions
and
7 deletions
src/metabase/driver/sql_jdbc/execute.clj
+
6
−
7
View file @
07e258a3
...
...
@@ -308,8 +308,7 @@
(
defn-
use-statement?
[
driver
params
]
(
and
(
statement-supported?
driver
)
(
empty?
params
)))
(
defn-
statement*
^
Statement
[
driver
conn
canceled-chan
]
(
defn-
statement*
^
Statement
[
driver
conn
canceled-chan
]
;; if canceled-chan gets a message, cancel the Statement
(
let
[
^
Statement
stmt
(
statement
driver
conn
)]
(
a/go
...
...
@@ -319,23 +318,23 @@
(
.cancel
stmt
))))
stmt
))
(
defn-
^
Statement
statement-or-prepared-statement
[
driver
conn
sql
params
canceled-chan
]
(
defn-
statement-or-prepared-statement
^
Statement
[
driver
conn
sql
params
canceled-chan
]
(
if
(
use-statement?
driver
params
)
(
statement*
driver
conn
canceled-chan
)
(
prepared-statement*
driver
conn
sql
params
canceled-chan
)))
(
defmethod
^
ResultSet
execute-prepared-statement!
:sql-jdbc
(
defmethod
execute-prepared-statement!
:sql-jdbc
[
_
^
PreparedStatement
stmt
]
(
.executeQuery
stmt
))
(
defmethod
^
ResultSet
execute-statement!
:sql-jdbc
(
defmethod
execute-statement!
:sql-jdbc
[
driver
^
Statement
stmt
^
String
sql
]
(
if
(
.execute
stmt
sql
)
(
.getResultSet
stmt
)
(
throw
(
ex-info
(
str
(
tru
"Select statement did not produce a ResultSet for native query"
))
{
:sql
sql
:driver
driver
}))))
(
defn-
^
ResultSet
execute-statement-or-prepared-statement
[
driver
^
Statement
stmt
max-rows
params
sql
]
(
defn-
execute-statement-or-prepared-statement
!
^
ResultSet
[
driver
^
Statement
stmt
max-rows
params
sql
]
(
let
[
st
(
doto
stmt
(
.setMaxRows
max-rows
))]
(
if
(
use-statement?
driver
params
)
(
execute-statement!
driver
st
sql
)
...
...
@@ -463,7 +462,7 @@
([
driver
sql
params
max-rows
context
respond
]
(
with-open
[
conn
(
connection-with-timezone
driver
(
qp.store/database
)
(
qp.timezone/report-timezone-id-if-supported
))
stmt
(
statement-or-prepared-statement
driver
conn
sql
params
(
context/canceled-chan
context
))
rs
(
execute-statement-or-prepared-statement
driver
stmt
max-rows
params
sql
)]
rs
(
execute-statement-or-prepared-statement
!
driver
stmt
max-rows
params
sql
)]
(
let
[
rsmeta
(
.getMetaData
rs
)
results-metadata
{
:cols
(
column-metadata
driver
rsmeta
)}]
(
respond
results-metadata
(
reducible-rows
driver
rs
rsmeta
(
context/canceled-chan
context
)))))))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment