forked from sijms/go-ora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbulkcopy_test.go
39 lines (35 loc) · 999 Bytes
/
bulkcopy_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package go_ora
import (
"github.com/sijms/go-ora/v2/converters"
"github.com/sijms/go-ora/v2/network"
"testing"
)
var inputBuffer = []byte{8, 1, 1, 1, 128, 0, 0, 1, 20, 0, 0, 0, 0, 2, 3, 105, 1, 1,
20, 0, 1, 0, 1, 4, 4, 78, 65, 77, 69, 0, 0, 0, 0, 0, 1, 14, 2, 1, 144,
2, 1, 144, 3, 1, 0, 0, 1, 5, 1, 1, 0, 0, 1, 32, 1, 22, 0, 0, 0, 0, 0, 4,
1, 7, 1, 6, 0, 0, 0, 0, 1, 5, 1, 39, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
func TestBulkCopyRead(t *testing.T) {
session := network.NewSessionWithInputBufferForDebug(inputBuffer)
session.TTCVersion = 12
conn := &Connection{
session: session,
}
conn.sStrConv = converters.NewStringConverter(873)
session.StrConv = conn.sStrConv
bulk := BulkCopy{
conn: conn,
TableName: "",
SchemaName: "",
PartitionName: "",
ColumnNames: nil,
columns: nil,
tableCursor: 0,
sdbaBits: 0,
dbaBits: 0,
}
err := bulk.readPrepareResponse()
if err != nil {
t.Error(err)
}
}