Sql server中内部函数fn_PhysLocFormatter存在解析错误详解

2020-07-04 05:59:30易采站长站整理

前言

有网友指出,SQL Server 2012中fn_PhysLocFormatter内部函数在解析数据行记录位置时存在错误,见:http://www.itpub.net/thread-1751655-1-1.html,实际测试后发现,一是2008R2中同样存在问题,二是不仅页号解析存在问题,槽号解析也存在同样问题。

下面先查看表NT_SiteInfo的数据行记录位置。


select SiteID,%%physloc%%,sys.fn_PhysLocFormatter(%%physloc%%) from NT_SiteInfo

相关文章 大家在看

SiteID

%%physloc%%

sys.fn_PhysLocFormatter(%%physloc%%)

1

0xE900000001000000

(1:59648:0)

23

0xE900000001000100

(1:59648:1)

24

0xE900000001000200

(1:59648:2)

 

……

 

149

0xE900000001007F00

(1:59648:127)

150

0xE900000001008000

(1:59648:128)

151

0xE900000001008100

(1:59648:33024)

152

0xE900000001008200

(1:59648:33280)

 

……

 

226

0xE90000000100CC00

(1:59648:52224)

227

0xE90000000100CD00

(1:59648:52480)

228

0x4B02000001000000

(1:587:0)

229

0x4B02000001000100

(1:587:1)

 

……

 

360

0x4B02000001007F00

(1:587:127)

361

0x4B02000001008000

(1:587:128)

362

0x4B02000001008100

(1:587:33024)

363

0x4B02000001008200

(1:587:33280)

 

……

 

422

0x4B0200000100BD00

(1:587:48384)

423

0x4B0200000100BE00

(1:587:48640)

424

0x3C05000001000000

(1:1340:0)

425

0x3C05000001000100

(1:1340:1)

 

……

 

552

0x3C05000001008000

(1:1340:128)

553

0x3C05000001008100

(1:1340:33024)