RE : RE : location of config parameter?
"Ludo Brands" <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <006301ccbe4f$3467bf50$6602a8c0@Ludo10> |
> > I have no problems sharing the changes I made. > > Thank you for that offer, Ludo. > > > - since this is a sybase only extension, I assume the > > TDS_REQ_LARGEIDENT capability request should be set only for recent > > Sybase servers, based on the existence of the SYBECAPTYP > error. What > > are the possibilities? > > I see no need to worry about capacity negotiation with old > Sybase servers. > > >From the design of the packet and Sybase's track record, I bet old > servers simply ignore (or acknowledge in the negative) > capacity requests they don't recognize. If you're a server > that supports 65 capacity bits and I'm a client asking for > #83, you can easily and safely say No. > > If someone reading this message knows of a new Sybase client > that cannot connect to an old Sybase server (that supports > TDS 5.0), that would certainly be evidence to the contrary. > > Absent that evidence, we can at least start with no switch. > That has the advantage of simplicity and of expoiting new > servers, which is, er, the way of the future. > > Regarding ENABLE_EXTRA_CHECKS, I would remove outdated code > from compilation until someone gets around to updating it. Just put > > # if CAPACITY_8_BYTES > > around the obsolete validation for now. If you want to fix > the validation instead, that's fine, too. > Attached the patch. "# if CAPACITY_8_BYTES" is put around the body of "static void tds_capability_test(void)" to make mods limited to mem.c. I wasn't able to test with ENABLE_EXTRA_CHECKS 1 because of missing functions such as tds_check_tds_extra (windows). Ludo _______________________________________________ FreeTDS mailing list [email protected] http://lists.ibiblio.org/mailman/listinfo/freetds
tds_capacity.diff
(application/octet-stream, 2.3 KB)
Index: include/tds.h
===================================================================
RCS file: /cvsroot/freetds/freetds/include/tds.h,v
retrieving revision 1.396
diff -c -r1.396 tds.h
*** include/tds.h 16 Dec 2011 09:53:52 -0000 1.396
--- include/tds.h 19 Dec 2011 12:56:27 -0000
***************
*** 419,425 ****
#define is_similar_type(x, y) ((is_char_type(x) && is_char_type(y)) || ((is_unicode_type(x) && is_unicode_type(y))))
! #define TDS_MAX_CAPABILITY 22
#define MAXPRECISION 77
#define TDS_MAX_CONN 4096
#define TDS_MAX_DYNID_LEN 30
--- 419,425 ----
#define is_similar_type(x, y) ((is_char_type(x) && is_char_type(y)) || ((is_unicode_type(x) && is_unicode_type(y))))
! #define TDS_MAX_CAPABILITY 25
#define MAXPRECISION 77
#define TDS_MAX_CONN 4096
#define TDS_MAX_DYNID_LEN 30
Index: src/tds/mem.c
===================================================================
RCS file: /cvsroot/freetds/freetds/src/tds/mem.c,v
retrieving revision 1.223
diff -c -r1.223 mem.c
*** src/tds/mem.c 1 Sep 2011 13:34:23 -0000 1.223
--- src/tds/mem.c 19 Dec 2011 12:56:27 -0000
***************
*** 680,687 ****
}
static const unsigned char defaultcaps[] = {
/* type, len, data, data, data, data, data, data, data, data, data (9 bytes) */
! 0x01, 0x09, 0x00, 0x08, 0x0E, 0x6D, 0x7F, 0xFF, 0xFF, 0xFF, 0xFE,
! 0x02, 0x09, 0x00, 0x00, 0x00, 0x00, 0x02, 0x68, 0x00, 0x00, 0x00
};
#if ENABLE_EXTRA_CHECKS
--- 680,687 ----
}
static const unsigned char defaultcaps[] = {
/* type, len, data, data, data, data, data, data, data, data, data (9 bytes) */
! 0x01, 0x0c, 0x07 ,0xcd, 0xff, 0x00, 0x08, 0x0E, 0x6D, 0x7F, 0xFF, 0xFF, 0xFF, 0xFE,
! 0x02, 0x09, 0x00, 0x00, 0x00, 0x00, 0x02, 0x68, 0x00, 0x00, 0x00
};
#if ENABLE_EXTRA_CHECKS
***************
*** 744,749 ****
--- 744,751 ----
static void
tds_capability_test(void)
{
+ # if CAPACITY_8_BYTES
+
unsigned char buf_capabilities[TDS_MAX_CAPABILITY];
unsigned char *capabilities[2];
int i, c, ncap;
***************
*** 772,777 ****
--- 774,780 ----
* that we used to create with magic numbers. Eventually we can delete defaultcaps and the below assertion.
*/
assert(0 == memcmp(buf_capabilities, defaultcaps, TDS_MAX_CAPABILITY));
+ #endif
}
#endif