@@ -12,7 +12,6 @@ package sqlx
1212import (
1313 "context"
1414 "database/sql"
15- "encoding/json"
1615 "fmt"
1716 "log"
1817 "strings"
@@ -1164,47 +1163,6 @@ func TestEmbeddedMapsContext(t *testing.T) {
11641163 })
11651164}
11661165
1167- func TestIssue197Context (t * testing.T ) {
1168- // this test actually tests for a bug in database/sql:
1169- // https://github.com/golang/go/issues/13905
1170- // this potentially makes _any_ named type that is an alias for []byte
1171- // unsafe to use in a lot of different ways (basically, unsafe to hold
1172- // onto after loading from the database).
1173- t .Skip ()
1174-
1175- type mybyte []byte
1176- type Var struct { Raw json.RawMessage }
1177- type Var2 struct { Raw []byte }
1178- type Var3 struct { Raw mybyte }
1179- RunWithSchemaContext (context .Background (), defaultSchema , t , func (ctx context.Context , db * DB , t * testing.T ) {
1180- var err error
1181- var v , q Var
1182- if err = db .GetContext (ctx , & v , `SELECT '{"a": "b"}' AS raw` ); err != nil {
1183- t .Fatal (err )
1184- }
1185- if err = db .GetContext (ctx , & q , `SELECT 'null' AS raw` ); err != nil {
1186- t .Fatal (err )
1187- }
1188-
1189- var v2 , q2 Var2
1190- if err = db .GetContext (ctx , & v2 , `SELECT '{"a": "b"}' AS raw` ); err != nil {
1191- t .Fatal (err )
1192- }
1193- if err = db .GetContext (ctx , & q2 , `SELECT 'null' AS raw` ); err != nil {
1194- t .Fatal (err )
1195- }
1196-
1197- var v3 , q3 Var3
1198- if err = db .QueryRowContext (ctx , `SELECT '{"a": "b"}' AS raw` ).Scan (& v3 .Raw ); err != nil {
1199- t .Fatal (err )
1200- }
1201- if err = db .QueryRowContext (ctx , `SELECT '{"c": "d"}' AS raw` ).Scan (& q3 .Raw ); err != nil {
1202- t .Fatal (err )
1203- }
1204- t .Fail ()
1205- })
1206- }
1207-
12081166func TestInContext (t * testing.T ) {
12091167 // some quite normal situations
12101168 type tr struct {
0 commit comments