встроенный блоб в сервере sql - PullRequest
1 голос
/ 16 февраля 2010

чей шестнадцатеричный дамп следующий

00000000: 30001100 013caae4 62010000 00000000 † 0 .... <.. b ....... <br> 00000010: 00060040 02002000 5c803801 02000000 † ... @ .. ..8 .....
00000020: 0400004d 01000000 384c0000 681f0000 † ... M .... 8L..h ...
00000030: e7010000 01000000 d03e0000 08020000 † .........> ......
00000040: 01000000 385e0000 09020000 01000000 † .... 8 ^ ..........
00000050: 926b0000 0a020000 01000000 ††††††††† поздрав с

один из столбцов в записи выглядит следующим образом

imageval = [BLOB Inline Root] Слот 2 Колонка 5 Смещение 0x20 Длина 60

Уровень = 0 Не используется = 77 UpdateSeq = 1 TimeStamp = 1278738432
Ссылка 0

Размер = 8040 RowId = (1: 487: 0)
Ссылка 1

Размер = 16080 RowId = (1: 520: 0)
Ссылка 2

Размер = 24120 RowId = (1: 521: 0)
Ссылка 3

Размер = 27538 RowId = (1: 522: 0)

как можно определить, является ли это [BLOB Inline Root]. Как мы интерпретируем вышеуказанные значения из шестнадцатеричного числа. Спасибо

1 Ответ

1 голос
/ 29 мая 2011

Нам понадобится схема таблицы, чтобы определить сохраненные значения ...

Как говорится:

3000 =>  
The two first flag bytes of the record.

1100 =>  
Length of the fixed length data (decimal value = 17), meaning the next 13 bytes are the fixed length data portion of the record.

013caae4 62010000 00000000 00 =>  
Fixed length data. No way to say what's what without schema.

0600 =>  
Total number of columns in the table.

40 =>  
The null bitmap array. Decimal 64 = 0b10000000 in binary, meaning the first column of the record is NULL.

0200 =>  
Number of variable length columns. Thus we can conclude you have 4 fixed-length columns since the total is 6.

2000 =>
Position offset of first variable length column. Decimal value 32. Data can thus be found from position 27-32 for a total of 6 bytes: 3801 02000000.

5c80 =>
Position offset of second variable length column. Decimal value 32.860, 0b1000000001011100 in binary. BLOB pointers are identified using the sign bit of the position offset value. Removing the sign bit from the equation gives a decimal value of 0b0000000001011100 = 92. The inline data can thus be found from bytes 33-92:

0400004d 01000000 384c0000 681f0000
e7010000 01000000 d03e0000 08020000
01000000 385e0000 09020000 01000000
926b0000 0a020000 01000000

BLOB Inline Roots start out with a header:

04 =>  
Special field type

00 =>  
Link

00 =>  
Index level

4d =>
Unused (field)

01000000 =>  
Update sequence

384c0000 =>  
Timestamp (unsigned)

And then finally we have the actual meat, an array of slot pointers:

Length   PageID   FileID  Slot
681f0000 e7010000 0100    0000
d03e0000 08020000 0100    0000
385e0000 09020000 0100    0000
926b0000 0a020000 0100    0000
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...