Skip to content

Commit c0fd3be

Browse files
committed
- Fix MDEV-16167 Cannot insert unsigned values into a VEC table
modified: storage/connect/filamvct.cpp modified: storage/connect/tabvct.cpp
1 parent fa7bbe5 commit c0fd3be

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

storage/connect/filamvct.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,8 @@ bool VCTFAM::AllocateBuffer(PGLOBAL g)
515515
for (; cp; cp = (PVCTCOL)cp->Next)
516516
cp->Blk = AllocValBlock(g, NewBlock + Nrec * cp->Deplac,
517517
cp->Buf_Type, Nrec, cp->Format.Length,
518-
cp->Format.Prec, chk);
518+
cp->Format.Prec, chk, true,
519+
cp->IsUnsigned());
519520

520521
return InitInsert(g); // Initialize inserting
521522
} else {
@@ -549,7 +550,8 @@ bool VCTFAM::AllocateBuffer(PGLOBAL g)
549550
for (; cp; cp = (PVCTCOL)cp->Next)
550551
if (!cp->IsSpecial()) // Not a pseudo column
551552
cp->Blk = AllocValBlock(g, NULL, cp->Buf_Type, Nrec,
552-
cp->Format.Length, cp->Format.Prec);
553+
cp->Format.Length, cp->Format.Prec,
554+
true, true, cp->IsUnsigned());
553555

554556
} //endif mode
555557

@@ -1516,7 +1518,8 @@ bool VCMFAM::AllocateBuffer(PGLOBAL g)
15161518
for (cp = (PVCTCOL)Tdbp->GetColumns(); cp; cp = (PVCTCOL)cp->Next)
15171519
if (!cp->IsSpecial()) { // Not a pseudo column
15181520
cp->Blk = AllocValBlock(g, (void*)1, cp->Buf_Type, Nrec,
1519-
cp->Format.Length, cp->Format.Prec);
1521+
cp->Format.Length, cp->Format.Prec,
1522+
true, true, cp->IsUnsigned());
15201523
cp->AddStatus(BUF_MAPPED);
15211524
} // endif IsSpecial
15221525

@@ -2067,7 +2070,7 @@ bool VECFAM::AllocateBuffer(PGLOBAL g)
20672070
for (cp = (PVCTCOL)tdbp->Columns; cp; cp = (PVCTCOL)cp->Next)
20682071
cp->Blk = AllocValBlock(g, To_Bufs[cp->Index - 1],
20692072
cp->Buf_Type, Nrec, cp->Format.Length,
2070-
cp->Format.Prec, chk);
2073+
cp->Format.Prec, chk, true, cp->IsUnsigned());
20712074

20722075
return InitInsert(g);
20732076
} else {
@@ -2116,7 +2119,8 @@ bool VECFAM::AllocateBuffer(PGLOBAL g)
21162119
for (cp = (PVCTCOL)tdbp->Columns; cp; cp = (PVCTCOL)cp->Next)
21172120
if (!cp->IsSpecial()) // Not a pseudo column
21182121
cp->Blk = AllocValBlock(g, NULL, cp->Buf_Type, Nrec,
2119-
cp->Format.Length, cp->Format.Prec);
2122+
cp->Format.Length, cp->Format.Prec,
2123+
true, true, cp->IsUnsigned());
21202124

21212125
} // endif mode
21222126

@@ -2887,7 +2891,8 @@ bool VMPFAM::AllocateBuffer(PGLOBAL g)
28872891
for (cp = (PVCTCOL)Tdbp->GetColumns(); cp; cp = (PVCTCOL)cp->Next)
28882892
if (!cp->IsSpecial()) { // Not a pseudo column
28892893
cp->Blk = AllocValBlock(g, (void*)1, cp->Buf_Type, Nrec,
2890-
cp->Format.Length, cp->Format.Prec);
2894+
cp->Format.Length, cp->Format.Prec,
2895+
true, true, cp->IsUnsigned());
28912896
cp->AddStatus(BUF_MAPPED);
28922897
} // endif IsSpecial
28932898

@@ -3669,7 +3674,7 @@ bool BGVFAM::AllocateBuffer(PGLOBAL g)
36693674
for (; cp; cp = (PVCTCOL)cp->Next)
36703675
cp->Blk = AllocValBlock(g, NewBlock + Nrec * cp->Deplac,
36713676
cp->Buf_Type, Nrec, cp->Format.Length,
3672-
cp->Format.Prec, chk);
3677+
cp->Format.Prec, chk, true, cp->IsUnsigned());
36733678

36743679
InitInsert(g); // Initialize inserting
36753680

@@ -3717,7 +3722,8 @@ bool BGVFAM::AllocateBuffer(PGLOBAL g)
37173722
for (; cp; cp = (PVCTCOL)cp->Next)
37183723
if (!cp->IsSpecial()) // Not a pseudo column
37193724
cp->Blk = AllocValBlock(g, NULL, cp->Buf_Type, Nrec,
3720-
cp->Format.Length, cp->Format.Prec);
3725+
cp->Format.Length, cp->Format.Prec,
3726+
true, true, cp->IsUnsigned());
37213727

37223728
} //endif mode
37233729

storage/connect/tabvct.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,13 +456,11 @@ bool VCTCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check)
456456

457457
if (tdbp->Txfp->GetAmType() == TYPE_AM_VMP && ok) {
458458
Blk = AllocValBlock(g, (void*)1, Buf_Type, tdbp->Txfp->Nrec,
459-
Format.Length,
460-
Format.Prec, check);
459+
Format.Length, Format.Prec, check, true, Unsigned);
461460
Status |= BUF_MAPPED; // Will point into mapped file
462461
} else
463462
Blk = AllocValBlock(g, NULL, Buf_Type, tdbp->Txfp->Nrec,
464-
Format.Length,
465-
Format.Prec, check);
463+
Format.Length, Format.Prec, check, true, Unsigned);
466464
} // endif Mode
467465

468466
return false;

0 commit comments

Comments
 (0)