File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -184,14 +184,22 @@ def stmt_count
184184 end
185185
186186 it "should tell us about the fields" do
187- statement = @client . prepare 'SELECT 1 as foo, 2'
187+ statement = @client . prepare 'SELECT 1 AS foo, 2'
188188 statement . execute
189189 list = statement . fields
190190 expect ( list . length ) . to eq ( 2 )
191191 expect ( list . first ) . to eq ( 'foo' )
192192 expect ( list [ 1 ] ) . to eq ( '2' )
193193 end
194194
195+ it "should give us fields when no rows" do
196+ statement = @client . prepare 'SELECT 1 AS foo FROM mysql2_test WHERE 1=0'
197+ result = statement . execute
198+ list = result . fields
199+ expect ( list . length ) . to eq ( 1 )
200+ expect ( list . first ) . to eq ( 'foo' )
201+ end
202+
195203 it "should handle as a decimal binding a BigDecimal" do
196204 stmt = @client . prepare ( 'SELECT ? AS decimal_test' )
197205 test_result = stmt . execute ( BigDecimal ( "123.45" ) ) . first
You can’t perform that action at this time.
0 commit comments