File tree 3 files changed +10
-3
lines changed
3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,13 @@ function Backend({
174
174
}
175
175
176
176
function RowDescription ( x ) {
177
+ if ( backend . query . result . command ) {
178
+ backend . query . results = backend . query . results || [ backend . query . result ]
179
+ backend . query . results . push ( backend . query . result = [ ] )
180
+ backend . query . result . count = null
181
+ backend . query . statement . columns = null
182
+ }
183
+
177
184
rows = 0
178
185
179
186
if ( backend . query . statement . columns )
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ function Connection(options = {}) {
131
131
? ( backend . query ? backend . query . reject ( err ) : error ( err ) )
132
132
: ( backend . query && backend . query . resolve ( backend . query . stream
133
133
? backend . query . result . count
134
- : backend . query . result ) )
134
+ : ( backend . query . results || backend . query . result ) ) )
135
135
136
136
backend . query = backend . error = null
137
137
timeout && queries . length === 0 && idle ( )
Original file line number Diff line number Diff line change @@ -681,8 +681,8 @@ t('Multiple queries', async() => {
681
681
t ( 'Multiple statements' , async ( ) =>
682
682
[ 2 , await sql . unsafe ( `
683
683
select 1 as x;
684
- select 2 as x ;
685
- ` ) . then ( ( [ , x ] ) => x . x ) ]
684
+ select 2 as a ;
685
+ ` ) . then ( ( [ , [ x ] ] ) => x . a ) ]
686
686
)
687
687
688
688
t ( 'throws correct error when authentication fails' , async ( ) => {
You can’t perform that action at this time.
0 commit comments