Skip to content

Commit 8b731b0

Browse files
committed
make all integers 64-bit in the SQL world
1 parent f4e1146 commit 8b731b0

File tree

7 files changed

+7
-2
lines changed

7 files changed

+7
-2
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,6 @@ very large output - the program may be able to restart from a more recent
5656
checkpoint.
5757
* Discovered a few fields in the WTAS structure are not used in the way
5858
the documentation and product header files claim.
59+
* Some SMF integers are too large for the INTEGER datatype. The unsigned
60+
32-bits compared to the SQL which is signed 32-bit, So switching
61+
to always use BIGINT.

bin/aix/convH

0 Bytes
Binary file not shown.

bin/aix/mqsmfcsv

0 Bytes
Binary file not shown.

bin/linux/mqsmfcsv

0 Bytes
Binary file not shown.

bin/win/mqsmfcsv.exe

0 Bytes
Binary file not shown.

src/mqsmf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ void takeCheckPoint(char *f, myoff_t pos) {
11101110
/********************************************************************/
11111111
/* Record offset and current status for the input file */
11121112
/********************************************************************/
1113-
b = fprintf(fp, "%d %lld %d\n",totalRecords,pos);
1113+
b = fprintf(fp, "%d %lld\n",totalRecords,pos);
11141114
for (i=0;i<MAXCP;i++) {
11151115
/* Record name and offset for all the output files */
11161116
if (checkPoint[i].name) {

src/smfDDL.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ void printDDL(char *name, int type, int len)
6262
switch (type)
6363
{
6464
case DDL_I:
65-
fprintf(fp,"%s %s \t INTEGER\n",comma,format(nameCopy));
65+
/* SQL Integer is a 'signed 32-bit' when sometimes we need unsigned */
66+
/* So make it a big int always */
67+
fprintf(fp,"%s %s \t BIGINT \n",comma,format(nameCopy));
6668
break;
6769
case DDL_I64:
6870
fprintf(fp,"%s %s \t BIGINT\n",comma,format(nameCopy));

0 commit comments

Comments
 (0)