Skip to content

Commit 636422f

Browse files
committed
changing test-server seqnum to uint64
Updating uint64 conversions
1 parent 7378173 commit 636422f

12 files changed

+22
-32
lines changed

_sql/mssql/quickfix_database.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ CREATE TABLE sessions (
1212
targetlocid VARCHAR(64) NOT NULL,
1313
session_qualifier VARCHAR(64) NOT NULL,
1414
creation_time DATETIME NOT NULL,
15-
incoming_seqnum INT NOT NULL,
16-
outgoing_seqnum INT NOT NULL,
15+
incoming_seqnum BIGINT NOT NULL,
16+
outgoing_seqnum BIGINT NOT NULL,
1717
PRIMARY KEY (beginstring, sendercompid, sendersubid, senderlocid,
1818
targetcompid, targetsubid, targetlocid, session_qualifier)
1919
);
@@ -27,7 +27,7 @@ CREATE TABLE messages (
2727
targetsubid VARCHAR(64) NOT NULL,
2828
targetlocid VARCHAR(64) NOT NULL,
2929
session_qualifier VARCHAR(64) NOT NULL,
30-
msgseqnum INT NOT NULL,
30+
msgseqnum BIGINT NOT NULL,
3131
message TEXT NOT NULL,
3232
PRIMARY KEY (beginstring, sendercompid, sendersubid, senderlocid,
3333
targetcompid, targetsubid, targetlocid, session_qualifier,

_sql/mysql/messages_table.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ CREATE TABLE messages (
1111
targetsubid VARCHAR(64) NOT NULL,
1212
targetlocid VARCHAR(64) NOT NULL,
1313
session_qualifier VARCHAR(64) NOT NULL,
14-
msgseqnum INT NOT NULL,
14+
msgseqnum BIGINT NOT NULL,
1515
message TEXT NOT NULL,
1616
PRIMARY KEY (beginstring, sendercompid, sendersubid, senderlocid,
1717
targetcompid, targetsubid, targetlocid, session_qualifier,

_sql/mysql/sessions_table.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ CREATE TABLE sessions (
1212
targetlocid VARCHAR(64) NOT NULL,
1313
session_qualifier VARCHAR(64) NOT NULL,
1414
creation_time DATETIME NOT NULL,
15-
incoming_seqnum INT NOT NULL,
16-
outgoing_seqnum INT NOT NULL,
15+
incoming_seqnum BIGINT NOT NULL,
16+
outgoing_seqnum BIGINT NOT NULL,
1717
PRIMARY KEY (beginstring, sendercompid, sendersubid, senderlocid,
1818
targetcompid, targetsubid, targetlocid, session_qualifier)
1919
);

_sql/oracle/messages_table.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CREATE TABLE messages (
77
targetsubid VARCHAR2(64) NOT NULL,
88
targetlocid VARCHAR2(64) NOT NULL,
99
session_qualifier VARCHAR2(64) NOT NULL,
10-
msgseqnum INTEGER NOT NULL,
10+
msgseqnum BIGINT NOT NULL,
1111
message VARCHAR2(4000) NOT NULL,
1212
PRIMARY KEY (beginstring, sendercompid, sendersubid, senderlocid,
1313
targetcompid, targetsubid, targetlocid, session_qualifier, msgseqnum)

_sql/oracle/sessions_table.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ CREATE TABLE sessions (
88
targetlocid VARCHAR2(64) NOT NULL,
99
session_qualifier VARCHAR2(64) NOT NULL,
1010
creation_time TIMESTAMP NOT NULL,
11-
incoming_seqnum INTEGER NOT NULL,
12-
outgoing_seqnum INTEGER NOT NULL,
11+
incoming_seqnum BIGINT NOT NULL,
12+
outgoing_seqnum BIGINT NOT NULL,
1313
PRIMARY KEY (beginstring, sendercompid, sendersubid, senderlocid,
1414
targetcompid, targetsubid, targetlocid, session_qualifier)
1515
);

_sql/postgresql/messages_table.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CREATE TABLE messages (
77
targetsubid VARCHAR(64) NOT NULL,
88
targetlocid VARCHAR(64) NOT NULL,
99
session_qualifier VARCHAR(64) NOT NULL,
10-
msgseqnum INTEGER NOT NULL,
10+
msgseqnum BIGINT NOT NULL,
1111
message TEXT NOT NULL,
1212
PRIMARY KEY (beginstring, sendercompid, sendersubid, senderlocid,
1313
targetcompid, targetsubid, targetlocid, session_qualifier,

_sql/postgresql/sessions_table.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ CREATE TABLE sessions (
88
targetlocid VARCHAR(64) NOT NULL,
99
session_qualifier VARCHAR(64) NOT NULL,
1010
creation_time TIMESTAMP WITH TIME ZONE NOT NULL,
11-
incoming_seqnum INTEGER NOT NULL,
12-
outgoing_seqnum INTEGER NOT NULL,
11+
incoming_seqnum BIGINT NOT NULL,
12+
outgoing_seqnum BIGINT NOT NULL,
1313
PRIMARY KEY (beginstring, sendercompid, sendersubid, senderlocid,
1414
targetcompid, targetsubid, targetlocid, session_qualifier)
1515
);

_sql/sqlite3/messages_table.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CREATE TABLE messages (
99
targetsubid VARCHAR(64) NOT NULL,
1010
targetlocid VARCHAR(64) NOT NULL,
1111
session_qualifier VARCHAR(64) NOT NULL,
12-
msgseqnum INT NOT NULL,
12+
msgseqnum BIGINT NOT NULL,
1313
message TEXT NOT NULL,
1414
PRIMARY KEY (beginstring, sendercompid, sendersubid, senderlocid,
1515
targetcompid, targetsubid, targetlocid, session_qualifier,

_sql/sqlite3/sessions_table.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ CREATE TABLE sessions (
1010
targetlocid VARCHAR(64) NOT NULL,
1111
session_qualifier VARCHAR(64) NOT NULL,
1212
creation_time DATETIME NOT NULL,
13-
incoming_seqnum INT NOT NULL,
14-
outgoing_seqnum INT NOT NULL,
13+
incoming_seqnum BIGINT NOT NULL,
14+
outgoing_seqnum BIGINT NOT NULL,
1515
PRIMARY KEY (beginstring, sendercompid, sendersubid, senderlocid,
1616
targetcompid, targetsubid, targetlocid, session_qualifier)
1717
);

_test/test-server/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func main() {
200200
}
201201
num, ok := queryParams["NEXTTARGETSEQNUM"]
202202
if ok {
203-
seqnumInt, cErr := strconv.Atoi(num[0])
203+
seqnumInt, cErr := strconv.ParseUint(num[0], 10, 64)
204204
if cErr != nil {
205205
fmt.Println("cannot find seqnum")
206206
os.Exit(1)
@@ -216,7 +216,7 @@ func main() {
216216

217217
num, ok = queryParams["NEXTSENDERSEQNUM"]
218218
if ok {
219-
seqnumInt, cErr := strconv.Atoi(num[0])
219+
seqnumInt, cErr := strconv.ParseUint(num[0], 10, 64)
220220
if cErr != nil {
221221
fmt.Println("cannot find seqnum")
222222
os.Exit(1)

fix_uint.go

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,7 @@ import (
2020
"strconv"
2121
)
2222

23-
// atoi is similar to the function in strconv, but is tuned for ints appearing in FIX field types.
24-
func atou(d []byte) (uint64, error) {
25-
// if d[0] == asciiMinus {
26-
// n, err := parseUInt64(d[1:])
27-
// return (-1) * n, err
28-
// }
29-
30-
return parseUInt64(d)
31-
}
32-
33-
// parseUInt is similar to the function in strconv, but is tuned for ints appearing in FIX field types.
23+
// parseUInt is similar to the function in strconv, but is tuned for uint64s appearing in FIX field types.
3424
func parseUInt64(d []byte) (n uint64, err error) {
3525
if len(d) == 0 {
3626
err = errors.New("empty bytes")
@@ -49,14 +39,14 @@ func parseUInt64(d []byte) (n uint64, err error) {
4939
return
5040
}
5141

52-
// FIXInt is a FIX Int Value, implements FieldValue.
42+
// FIXUInt64 is a FIX Uint64 Value, implements FieldValue.
5343
type FIXUint64 uint64
5444

55-
// Int converts the FIXInt value to int.
45+
// Uint64 converts the FIXUint64 value to uint64.
5646
func (f FIXUint64) Uint64() uint64 { return uint64(f) }
5747

5848
func (f *FIXUint64) Read(bytes []byte) error {
59-
i, err := atou(bytes)
49+
i, err := parseUInt64(bytes)
6050
if err != nil {
6151
return err
6252
}

store/sql/sql_store.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ func (store *sqlStore) Refresh() error {
245245
func (store *sqlStore) populateCache() error {
246246
s := store.sessionID
247247
var creationTime time.Time
248-
var incomingSeqNum, outgoingSeqNum int
248+
var incomingSeqNum, outgoingSeqNum uint64
249249
row := store.db.QueryRow(sqlString(store.sqlGetSeqNums, store.placeholder),
250250
s.BeginString, s.Qualifier,
251251
s.SenderCompID, s.SenderSubID, s.SenderLocationID,

0 commit comments

Comments
 (0)