Files
@ e23e3482a0b7
Branch filter:
Location: DA/protocols/oracle-protocol.labnotes
e23e3482a0b7
2.3 KiB
text/plain
more stuff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
/* */ public class Packet
/* */ implements SQLnetDef
/* */ {
/* */ private int buffer2send;
/* */ protected int sdu;
/* */ protected int tdu;
/* */ protected int length;
/* */ public int type;
/* */ protected int flags;
/* */ protected int dataLen;
/* */ protected int dataOff;
/* */ protected String data;
/* */ protected byte[] buffer;
/* 112 */ protected int leftOverFromPreviousRead = 0;
/* */
/* */
Packet class, size is SDU
DataPacket
netinputstream on top (same as MAPI block stream essentially)
packets on top again ?!?
unmarshalOneRow
rowSpaceIndicator points to beginning of row in result set?
rowSpaceIndicator = pointer into row buffer
fields: known lengths or strings with char >> 1 leng prefix
/* 1032 */ lenoffset = columnIndex + charLength * currentRow;
/* 1033 */ int len = rowSpaceChar[lenoffset] >> '\001';
/* */
/* 1035 */ if (len > internalTypeMaxLength) {
/* 1036 */ len = internalTypeMaxLength;
/* */ }
/* 1038 */ result = new String(rowSpaceChar, lenoffset + 1, len);
16 bit -> 15 bit string length
/* 252 */ if (rowSpaceIndicator[(indicatorIndex + currentRow)] != -1)
/* */ {
/* 254 */ off = columnIndex + byteLength * currentRow;
/* 255 */ int year = oracleYear(off);
/* */
/* 257 */ Calendar cal2 = (Calendar)cal.clone();
/* */
/* 259 */ cal2.set(year, oracleMonth(off), oracleDay(off), 0, 0, 0);
/* 260 */ cal2.set(14, 0);
/* */
/* */
/* */
/* 264 */ if ((year > 0) && (cal2.isSet(0))) {
/* 265 */ cal2.set(0, 1);
/* */ }
/* 267 */ result = new Date(cal2.getTimeInMillis());
/* */ }
/* */
/* */
NumberCommonAccessor interesting binary
oracle.jdbc.driver.T4CCharAccessor.unmarshalOneRow()
int32, char(10);
42, 'DPFKG'
100 00 00 00 OK
https://dev.mysql.com/doc/internals/en/binary-protocol-resultset-row.html
https://github.com/siddontang/go-mysql/blob/master/Godeps/_workspace/src/github.com/go-sql-driver/mysql/packets.go
https://dev.mysql.com/doc/internals/en/integer.html#length-encoded-integer
[ 6899, "systemfunctions" ]
[ 6899, "systemfunctions" ]
|