Skip to content

Commit 27f9d2f

Browse files
committed
Commit updating CONNECT from the 10.1 version
1 parent dc8a0df commit 27f9d2f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+7733
-1057
lines changed

storage/connect/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ tabvct.cpp tabvir.cpp tabxcl.cpp valblk.cpp value.cpp xindex.cpp xobject.cpp
2828

2929
array.h blkfil.h block.h catalog.h checklvl.h colblk.h connect.h csort.h
3030
engmsg.h filamap.h filamdbf.h filamfix.h filamtxt.h filamvct.h filamzip.h
31-
filter.h global.h ha_connect.h inihandl.h json.h maputil.h msgid.h mycat.h
32-
myconn.h myutil.h os.h osutil.h plgcnx.h plgdbsem.h preparse.h reldef.h
31+
filter.h global.h ha_connect.h inihandl.h json.h jsonudf.h maputil.h msgid.h
32+
mycat.h myconn.h myutil.h os.h osutil.h plgcnx.h plgdbsem.h preparse.h reldef.h
3333
resource.h tabcol.h tabdos.h tabfix.h tabfmt.h tabjson.h tabmul.h tabmysql.h
3434
taboccur.h tabpivot.h tabsys.h tabtbl.h tabutil.h tabvct.h tabvir.h tabxcl.h
3535
user_connect.h valblk.h value.h xindex.h xobject.h xtable.h)
@@ -48,7 +48,7 @@ IF(UNIX)
4848
# Bar: -Wfatal-errors removed (does not present in gcc on solaris10)
4949
if(WITH_WARNINGS)
5050
add_definitions(-Wall -Wextra -Wmissing-declarations)
51-
message(STATUS "CONNECT: GCC: All warnings enabled")
51+
#message(STATUS "CONNECT: GCC: All warnings enabled")
5252
else()
5353
add_definitions(-Wall -Wmissing-declarations)
5454
add_definitions(-Wno-write-strings)
@@ -69,7 +69,7 @@ IF(UNIX)
6969
# These switches are for C++ only
7070
# add_definitions(-Wno-reorder)
7171

72-
message(STATUS "CONNECT: GCC: Some warnings disabled")
72+
#message(STATUS "CONNECT: GCC: Some warnings disabled")
7373
endif(WITH_WARNINGS)
7474

7575
add_definitions( -DUNIX -DLINUX -DUBUNTU )

storage/connect/connect.cc

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -735,17 +735,12 @@ static void SetSwapValue(PVAL valp, char *kp)
735735
/* IndexRead: fetch a record having the index value. */
736736
/***********************************************************************/
737737
RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
738-
const void *key, int len, bool mrr)
738+
const key_range *kr, bool mrr)
739739
{
740-
char *kp= (char*)key;
741740
int n, x;
742-
short lg;
743-
bool rcb;
744741
RCODE rc;
745-
PVAL valp;
746-
PCOL colp;
747742
XXBASE *xbp;
748-
PTDBDOX tdbp;
743+
PTDBDOX tdbp;
749744

750745
if (!ptdb)
751746
return RC_FX;
@@ -757,13 +752,13 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
757752
return RC_FX;
758753
} else if (x == 2) {
759754
// Remote index
760-
if (ptdb->ReadKey(g, op, key, len))
755+
if (ptdb->ReadKey(g, op, kr))
761756
return RC_FX;
762757

763758
goto rnd;
764759
} else if (x == 3) {
765-
if (key)
766-
((PTDBASE)ptdb)->SetRecpos(g, *(int*)key);
760+
if (kr)
761+
((PTDBASE)ptdb)->SetRecpos(g, *(int*)kr->key);
767762

768763
if (op == OP_SAME)
769764
return RC_NF;
@@ -790,7 +785,14 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
790785

791786
xbp= (XXBASE*)tdbp->To_Kindex;
792787

793-
if (key) {
788+
if (kr) {
789+
char *kp= (char*)kr->key;
790+
int len= kr->length;
791+
short lg;
792+
bool rcb;
793+
PVAL valp;
794+
PCOL colp;
795+
794796
for (n= 0; n < tdbp->Knum; n++) {
795797
colp= (PCOL)tdbp->To_Key_Col[n];
796798

@@ -832,10 +834,10 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
832834

833835
kp+= valp->GetClen();
834836

835-
if (len == kp - (char*)key) {
837+
if (len == kp - (char*)kr->key) {
836838
n++;
837839
break;
838-
} else if (len < kp - (char*)key) {
840+
} else if (len < kp - (char*)kr->key) {
839841
strcpy(g->Message, "Key buffer is too small");
840842
return RC_FX;
841843
} // endif len

storage/connect/connect.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ bool CntRewindTable(PGLOBAL g, PTDB tdbp);
3636
int CntCloseTable(PGLOBAL g, PTDB tdbp, bool nox, bool abort);
3737
int CntIndexInit(PGLOBAL g, PTDB tdbp, int id, bool sorted);
3838
RCODE CntReadNext(PGLOBAL g, PTDB tdbp);
39-
RCODE CntIndexRead(PGLOBAL g, PTDB, OPVAL op, const void *k, int n, bool mrr);
39+
RCODE CntIndexRead(PGLOBAL g, PTDB, OPVAL op, const key_range *kr, bool mrr);
4040
RCODE CntWriteRow(PGLOBAL g, PTDB tdbp);
4141
RCODE CntUpdateRow(PGLOBAL g, PTDB tdbp);
4242
RCODE CntDeleteRow(PGLOBAL g, PTDB tdbp, bool all);
@@ -60,7 +60,7 @@ class TDBDOX: public TDBDOS {
6060
friend int MakeIndex(PGLOBAL, PTDB, PIXDEF);
6161
friend int CntCloseTable(PGLOBAL, PTDB, bool, bool);
6262
friend int CntIndexInit(PGLOBAL, PTDB, int, bool);
63-
friend RCODE CntIndexRead(PGLOBAL, PTDB, OPVAL, const void*, int, bool);
63+
friend RCODE CntIndexRead(PGLOBAL, PTDB, OPVAL, const key_range*, bool);
6464
friend RCODE CntDeleteRow(PGLOBAL, PTDB, bool);
6565
friend int CntIndexRange(PGLOBAL, PTDB, const uchar**, uint*,
6666
bool*, key_part_map*);

storage/connect/filamzip.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1404,8 +1404,13 @@ void ZLBFAM::Rewind(void)
14041404
// We must be positioned after the header block
14051405
if (CurBlk >= 0) { // Nothing to do if no block read yet
14061406
if (!Optimized) { // If optimized, fseek will be done in ReadBuffer
1407+
size_t st;
1408+
14071409
rewind(Stream);
1408-
fread(Zlenp, sizeof(int), 1, Stream);
1410+
1411+
if (!(st = fread(Zlenp, sizeof(int), 1, Stream)) && trace)
1412+
htrc("fread error %d in Rewind", errno);
1413+
14091414
fseek(Stream, *Zlenp + sizeof(int), SEEK_SET);
14101415
OldBlk = -1;
14111416
} // endif Optimized

0 commit comments

Comments
 (0)