Skip to content

Commit 2c43371

Browse files
committed
2 parents bbad27a + 684fd6d commit 2c43371

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

conn.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ func (c *Conn) Close() error {
4646
return releaseHandle(h)
4747
}
4848

49-
//Query method executes the stament with out prepare
49+
//Query method executes the statement with out prepare if no args provided, and a driver.ErrSkip otherwise (handled by sql.go to execute usual preparedStmt)
5050
func (c *Conn) Query(query string, args []driver.Value) (driver.Rows, error) {
51+
if len(args) > 0 {
52+
// Not implemented for queries with parameters
53+
return nil, driver.ErrSkip
54+
}
5155
var out api.SQLHANDLE
5256
var os *ODBCStmt
5357
ret := api.SQLAllocHandle(api.SQL_HANDLE_STMT, api.SQLHANDLE(c.h), &out)
@@ -77,4 +81,4 @@ func (c *Conn) Query(query string, args []driver.Value) (driver.Rows, error) {
7781
return nil, err
7882
}
7983
return &Rows{os: os}, nil
80-
}
84+
}

0 commit comments

Comments
 (0)