In SQL Server 2014, you can compile the tables and stored procedures to native code. This concept is called Native Compilation.
Native Compilation:
Native Compilation is a new concept introduced in SQL Server 2014. Native compilation allows the tables and the stored procedures accessing them to be loaded on the memory. The tables and stored procedures loaded on the memory tends to be faster than the regular tables and stored procedures. The output of native compilation is DLL. These dlls are loaded to the SQL Server Process.
This dll creation process happens during the creation of memory optimized tables and memory optimized stored procedures. So there is no additional step for creating the dlls. This will be handled during the memory optimized object creation.
These memory optimized objects are re-compiled to dll, every time the sql server restarts.
Native Compilation of Tables:
The table is natively compiled when they are created using the table option memory_optimized=on. This option is used for creating the table optimized for In-Memory OLTP. On executing the create table script, the SQL Server Engine, compiles the script to native code and outputs a dll file. This dll file will be loaded to the memory for faster data access. For creating a memory optimized table, read the article Creating Table Optimized for In-Memory OLTP.
This resulting native compiled dll files are not stored in the database. Instead they are stored in the physical file system in the hard disk. You can see the location of the files using the dynamic management view dm_os_loaded_modules.
1 2 | Select * From sys.dm_os_loaded_modules Where Name Like '%' + cast (object_id( 'dbo.MyTecBits_Names_1' ) AS Varchar (10)) + '%' |
This dmv gives you the location of the files created for the memory optimized table, including the native compiled dll. If you go to the folder you can see several files with the same object id. One of the file will be “C” native code file and another is the resultant dll.
If you open the file with c extension, you can see the code written in c, so as to be compiled to a dll. Below is the sample c code. The table creation script is converted to c code and then compiled to a dll file. The natively compiled files for the table starts with the extension xtp_t_.
Sample Native c Code for Table:
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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | #define __in #define __out #define __inout #define __in_opt #define __out_opt #define __inout_opt #define __in_ecount(x) #define __out_ecount(x) #define __deref_out_ecount(x) #define __inout_ecount(x) #define __in_bcount(x) #define __out_bcount(x) #define __deref_out_bcount(x) #define __deref_out_range(x, y) #define __success(x) #define __inout_bcount(x) #define __deref_opt_out #define __deref_out #define __checkReturn #define __callback #define __nullterminated typedef unsigned char bool ; typedef unsigned short wchar_t ; typedef long HRESULT ; typedef unsigned __int64 ULONG_PTR ; #include "hkenggen.h" #include "hkrtgen.h" #include "hkgenlib.h" #define ENABLE_INTSAFE_SIGNED_FUNCTIONS #include "intsafe.h" int _fltused = 0; int memcmp ( const void *, const void *, size_t ); void * memcpy ( void *, const void *, size_t ); void * memset ( void *, int , size_t ); #define offsetof(s,f) ((size_t)&(((s*)0)->f)) struct NullBitsStruct_277576027 { unsigned char hkc_isnull_2:1; unsigned char hkc_isnull_3:1; }; struct hkt_277576027 { long hkc_1; long hkc_2; struct NullBitsStruct_277576027 null_bits; unsigned short hkvdo[2]; }; struct hkis_27757602700002 { long hkc_1; }; struct hkif_27757602700002 { long hkc_1; }; unsigned short GetSerializeSize_277576027( struct HkRow const * hkRow) { struct hkt_277576027 const * row = (( struct hkt_277576027 const *)hkRow); return ((row->hkvdo)[1]); } HRESULT Serialize_277576027( struct HkRow const * hkRow, unsigned char * buffer, unsigned short bufferSize, unsigned short * copySize) { return (RowSerialize(hkRow, (GetSerializeSize_277576027(hkRow)), buffer, bufferSize, copySize)); } HRESULT Deserialize_277576027( struct HkTransaction* tx, struct HkTable* table, unsigned char const * data, unsigned short datasize, struct HkRow** hkrow) { return (RowDeserialize(tx, table, data, datasize, sizeof ( struct hkt_277576027), ( sizeof ( struct hkt_277576027) + 30), hkrow)); } unsigned short GetSerializeRecKeySize_277576027( struct HkRow const * hkRow) { struct hkt_277576027 const * row = (( struct hkt_277576027 const *)hkRow); unsigned short size = sizeof ( struct hkif_27757602700002); return size; } HRESULT SerializeRecKey_27757602700002( struct HkRow const * hkRow, unsigned char * hkKey, unsigned short bufferSize, unsigned short * keySize) { struct hkt_277576027 const * row = (( struct hkt_277576027 const *)hkRow); struct hkif_27757602700002* key = (( struct hkif_27757602700002*)hkKey); (*keySize) = sizeof ( struct hkif_27757602700002); if ((bufferSize < (*keySize))) { return -2013265920; } (key->hkc_1) = (row->hkc_1); return 0; } HRESULT DeserializeRecKey_277576027( unsigned char const * data, unsigned short dataSize, struct HkSearchKey* key, unsigned short bufferSize) { struct hkif_27757602700002 const * source = (( struct hkif_27757602700002 const *)data); struct hkis_27757602700002* target = (( struct hkis_27757602700002*)key); unsigned long targetSize = sizeof ( struct hkis_27757602700002); if ((targetSize > bufferSize)) { return -2013265920; } (target->hkc_1) = (source->hkc_1); return 0; } __int64 CompareSKeyToRow_27757602700002( struct HkSearchKey const * hkArg0, struct HkRow const * hkArg1) { struct hkis_27757602700002* arg0 = (( struct hkis_27757602700002*)hkArg0); struct hkt_277576027* arg1 = (( struct hkt_277576027*)hkArg1); __int64 ret; ret = (CompareKeys_int((arg0->hkc_1), (arg1->hkc_1))); return ret; } __int64 CompareRowToRow_27757602700002( struct HkRow const * hkArg0, struct HkRow const * hkArg1) { struct hkt_277576027* arg0 = (( struct hkt_277576027*)hkArg0); struct hkt_277576027* arg1 = (( struct hkt_277576027*)hkArg1); __int64 ret; ret = (CompareKeys_int((arg0->hkc_1), (arg1->hkc_1))); return ret; } unsigned long ComputeSKeyHash_27757602700002( struct HkSearchKey const * hkArg) { struct hkis_27757602700002* arg = (( struct hkis_27757602700002*)hkArg); unsigned long hashState = 0; unsigned long hashValue = 0; hashValue = (ComputeHash_int((arg->hkc_1), (&hashState))); return hashValue; } unsigned long ComputeRowHash_27757602700002( struct HkRow const * hkArg) { struct hkt_277576027* arg = (( struct hkt_277576027*)hkArg); unsigned long hashState = 0; unsigned long hashValue = 0; hashValue = (ComputeHash_int((arg->hkc_1), (&hashState))); return hashValue; } struct HkOffsetInfo const KeyOffsetArray_27757602700002[] = { { offsetof( struct hkis_27757602700002, hkc_1), 0, 0, }, }; struct HkKeyColsInfo const KeyColsInfoArray_277576027[] = { { sizeof ( struct hkis_27757602700002), KeyOffsetArray_27757602700002, sizeof ( struct hkis_27757602700002), sizeof ( struct hkis_27757602700002), }, }; struct HkOffsetInfo const OffsetArray_277576027[] = { { offsetof( struct hkt_277576027, hkc_1), 0, 0, }, { offsetof( struct hkt_277576027, hkc_2), (offsetof( struct hkt_277576027, null_bits) + 0), 1, }, { (offsetof( struct hkt_277576027, hkvdo) + 0), (offsetof( struct hkt_277576027, null_bits) + 0), 2, }, }; struct HkColsInfo const ColsInfo_277576027 = { sizeof ( struct hkt_277576027), OffsetArray_277576027, KeyColsInfoArray_277576027, }; struct HkHashIndexMD HashIndexMD_277576027[] = { { 2, 1, 33554432, CompareSKeyToRow_27757602700002, CompareRowToRow_27757602700002, ComputeSKeyHash_27757602700002, ComputeRowHash_27757602700002, }, }; struct HkTableMD TableMD = { sizeof ( struct hkt_277576027), ( sizeof ( struct hkt_277576027) + 30), 1, HashIndexMD_277576027, 0, 0, 0, (&ColsInfo_277576027), 277576027, 0, GetSerializeSize_277576027, Serialize_277576027, Deserialize_277576027, GetSerializeRecKeySize_277576027, SerializeRecKey_27757602700002, DeserializeRecKey_277576027, }; __declspec ( dllexport ) struct HkTableBindings g_Bindings = { 277576027, (&TableMD), }; |
Native Compilation of Stored procedures:
The stored procedure is natively compiled when they are created using the option NATIVE_COMPILATION. This option is used for creating the stored procedure optimized for In-Memory OLTP. On executing the create procedure script, the SQL Server Engine, compiles the script to native code and outputs a dll file. This dll file will be loaded to the memory for faster data access. For creating memory optimized stored procedure, read the article Natively Compiled Stored Procedure.
Just like the memory native compilation of tables, the resulting native compiled dll files for stored procedures are stored in the physical file system in the hard disk. You can see them in the same folder where you saw the compiled files for tables. You can also see the location of the files using the dynamic management view dm_os_loaded_modules.
1 2 | Select * From sys.dm_os_loaded_modules Where Name Like '%' + cast (object_id( 'dbo.MTB_Insert_Records' ) AS Varchar (10)) + '%' |
Below is the sample c code created during the compilation of stored procedure. Just like the memory optimized tables the memory optimized stored procedure creation script is converted to c code and then compiled to a dll file. The natively compiled files for the table starts with the extension xtp_p_.
Sample Native c Code for Stored Procedure:
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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 | #define __in #define __out #define __inout #define __in_opt #define __out_opt #define __inout_opt #define __in_ecount(x) #define __out_ecount(x) #define __deref_out_ecount(x) #define __inout_ecount(x) #define __in_bcount(x) #define __out_bcount(x) #define __deref_out_bcount(x) #define __deref_out_range(x, y) #define __success(x) #define __inout_bcount(x) #define __deref_opt_out #define __deref_out #define __checkReturn #define __callback #define __nullterminated typedef unsigned char bool ; typedef unsigned short wchar_t ; typedef long HRESULT ; typedef unsigned __int64 ULONG_PTR ; #include "hkenggen.h" #include "hkrtgen.h" #include "hkgenlib.h" #define ENABLE_INTSAFE_SIGNED_FUNCTIONS #include "intsafe.h" int _fltused = 0; int memcmp ( const void *, const void *, size_t ); void * memcpy ( void *, const void *, size_t ); void * memset ( void *, int , size_t ); #define offsetof(s,f) ((size_t)&(((s*)0)->f)) struct NullBitsStruct_277576027 { unsigned char hkc_isnull_2:1; unsigned char hkc_isnull_3:1; }; struct hkt_277576027 { long hkc_1; long hkc_2; struct NullBitsStruct_277576027 null_bits; unsigned short hkvdo[2]; }; struct hkis_27757602700002 { long hkc_1; }; struct hkif_27757602700002 { long hkc_1; }; struct NullBitsStruct_309576141 { unsigned char hkc_isnull_2:1; unsigned char hkc_isnull_3:1; }; struct hkt_309576141 { long hkc_1; long hkc_2; struct NullBitsStruct_309576141 null_bits; unsigned short hkvdo[2]; }; struct hkis_30957614100002 { long hkc_1; }; struct hkif_30957614100002 { long hkc_1; }; unsigned long TableIds[] = { 277576027, 309576141, }; struct HkTable* Tables[2]; struct HkRootTableRow* TableStabilizeRootTableRows[2]; HRESULT hkp_421576540( struct HkProcContext* context, union HkValue valueArray[], unsigned char * nullArray) { unsigned long yc = 0; long var_2 = (-2147483647 - 1); unsigned char var_isnull_2 = 1; long var_3 = (-2147483647 - 1); unsigned char var_isnull_3 = 1; long var_4 = (-2147483647 - 1); unsigned char var_isnull_4 = 1; long var_5 = (-2147483647 - 1); unsigned char var_isnull_5 = 1; struct HkCursorHash* cur_13 = 0; HRESULT hr = 0; struct HkCursorHash* cur_29 = 0; hr = (HkCursorHashAlloc((Tables[0]), 0, 0, 0, (context->ErrorObject), (&cur_13), 0)); if ((FAILED(hr))) { goto l_1; } hr = (HkCursorHashAlloc((Tables[1]), 0, 0, 0, (context->ErrorObject), (&cur_29), 0)); if ((FAILED(hr))) { goto l_1; } { long expr_7 = (-2147483647 - 1); unsigned char expr_isnull_7; struct hkt_277576027* rec1_14; goto l_21; l_15:; hr = (HkCursorHashGetFirst(cur_13, (context->Transaction), 0, 0, 1, (( struct HkRow const **)(&rec1_14)))); if ((FAILED(hr))) { goto l_6; } l_18:; if ((hr == 0)) { goto l_11; } else { goto l_12; } l_19:; hr = (HkCursorHashGetNext(cur_13, (context->ErrorObject), (( struct HkRow const **)(&rec1_14)))); if ((FAILED(hr))) { goto l_6; } goto l_18; l_21:; expr_isnull_7 = 0; expr_7 = 0; goto l_15; l_11:; expr_7 = (expr_7 + 1); goto l_19; l_12:; goto l_10; l_10:; if ((! expr_isnull_7)) { var_2 = expr_7; var_isnull_2 = 0; } else { var_isnull_2 = 1; } goto l_8; l_8:; goto l_9; l_9:; l_6:; if ((FAILED(hr))) { SetLineNumberForError((context->ErrorObject), 8); goto l_1; } } yc = (yc + 1); { long expr_23 = (-2147483647 - 1); unsigned char expr_isnull_23; struct hkt_309576141* rec1_30; goto l_37; l_31:; hr = (HkCursorHashGetFirst(cur_29, (context->Transaction), 0, 0, 1, (( struct HkRow const **)(&rec1_30)))); if ((FAILED(hr))) { goto l_22; } l_34:; if ((hr == 0)) { goto l_27; } else { goto l_28; } l_35:; hr = (HkCursorHashGetNext(cur_29, (context->ErrorObject), (( struct HkRow const **)(&rec1_30)))); if ((FAILED(hr))) { goto l_22; } goto l_34; l_37:; expr_isnull_23 = 0; expr_23 = 0; goto l_31; l_27:; expr_23 = (expr_23 + 1); goto l_35; l_28:; goto l_26; l_26:; if ((! expr_isnull_23)) { var_3 = expr_23; var_isnull_3 = 0; } else { var_isnull_3 = 1; } goto l_24; l_24:; goto l_25; l_25:; l_22:; if ((FAILED(hr))) { SetLineNumberForError((context->ErrorObject), 9); goto l_1; } } yc = (yc + 1); { unsigned char result_39; unsigned char result_40; long isnull_value_41; unsigned char result_42; long isnull_value_43; result_39 = 0; result_40 = 0; if (var_isnull_2) { isnull_value_41 = 0; } else { isnull_value_41 = var_2; } result_40 = (isnull_value_41 == 0); if ((! result_40)) { goto l_39; } result_42 = 0; if (var_isnull_3) { isnull_value_43 = 0; } else { isnull_value_43 = var_3; } result_42 = (isnull_value_43 == 0); if ((! result_42)) { goto l_39; } result_39 = 1; l_39:; if (result_39) { { var_4 = 1; var_isnull_4 = 0; } yc = (yc + 1); { while (1) { unsigned char result_48; unsigned char result_isnull_48; result_48 = 0; result_isnull_48 = 0; if ((! var_isnull_4)) { result_48 = (var_4 <= 1000000); } else { result_isnull_48 = 1; } if ((result_isnull_48 || (! result_48))) { goto l_46; } hr = (YieldCheck(context, yc, 18)); if ((FAILED(hr))) { goto l_1; } yc = 0; { double temp_50; __int64 temp_51; if ((! 0)) { SetFloatingPointControl(); __try { temp_50 = ((Rand()) * 9.9000000000000000e+001); ConvertDoubleTo64(temp_50, (&temp_51)); if ((temp_51 < -99)) { hr = -2113929211; { hr = (CreateError((context->ErrorObject), hr, 2, 6, 9)); } if ((FAILED(hr))) { goto l_49; } } if ((temp_51 > 99)) { hr = -2113929212; { hr = (CreateError((context->ErrorObject), hr, 2, 6, 9)); } if ((FAILED(hr))) { goto l_49; } } var_5 = (( long )(( __int64 )temp_51)); var_isnull_5 = 0; } __except((ExceptionFilter((_exception_code()), (&hr)))) { CreateError((context->ErrorObject), hr, 0); goto l_49; } } else { var_isnull_5 = 1; } l_49:; if ((FAILED(hr))) { SetLineNumberForError((context->ErrorObject), 18); goto l_1; } } yc = (yc + 1); { unsigned char * expr_55 = ((context->DeepDataBuffer) + 0); unsigned short exprl_55 = 0; unsigned char const * hktmp_60; short hktmp_length_60; unsigned char willTargetDestinationBufferRemainTheSame_60 = 1; static unsigned char const hkl_61[] = { 78, 97, 109, 101, 32, 45, 32, 83, 111, 109, 101, 32, 78, 97, 109, 101, }; struct hkt_277576027* rec2_62 = 0; unsigned char freeRow_62 = 0; short rowLength; short varColLength; static wchar_t const hkl_63[] = { 73, 78, 83, 69, 82, 84, }; static wchar_t const hkl_64[] = { 91, 77, 121, 84, 101, 99, 66, 105, 116, 115, 95, 78, 97, 109, 101, 115, 95, 49, 93, }; static wchar_t const hkl_65[] = { 91, 83, 108, 95, 110, 111, 93, }; goto l_59; l_59:; hktmp_length_60 = exprl_55; hktmp_60 = expr_55; exprl_55 = 0; exprl_55 = (exprl_55 + 16); memcpy (expr_55, hkl_61, 16); goto l_58; l_58:; rowLength = sizeof ( struct hkt_277576027); varColLength = 0; varColLength = (varColLength + exprl_55); rowLength = (rowLength + varColLength); hr = (HkRowAlloc((context->Transaction), (Tables[0]), rowLength, (( struct HkRow**)(&rec2_62)))); if ((FAILED(hr))) { goto l_54; } freeRow_62 = 1; if ((! var_isnull_4)) { (rec2_62->hkc_1) = var_4; } else { hr = -2113929186; if ((FAILED(hr))) { { CreateError((context->ErrorObject), hr, 5, 14, hkl_65, 38, hkl_64, hkl_63); } if ((FAILED(hr))) { goto l_54; } } } if ((! var_isnull_5)) { (rec2_62->hkc_2) = var_5; ((rec2_62->null_bits).hkc_isnull_2) = 0; } else { ((rec2_62->null_bits).hkc_isnull_2) = 1; } ((rec2_62->hkvdo)[0]) = sizeof ( struct hkt_277576027); memcpy ((((unsigned char *)rec2_62) + ((rec2_62->hkvdo)[0])), expr_55, exprl_55); ((rec2_62->null_bits).hkc_isnull_3) = 0; ((rec2_62->null_bits).hkc_isnull_3) = 0; ((rec2_62->hkvdo)[1]) = (((rec2_62->hkvdo)[0]) + varColLength); freeRow_62 = 0; hr = (HkTableInsert((Tables[0]), (context->Transaction), (( struct HkRow*)rec2_62))); if ((FAILED(hr))) { goto l_54; } goto l_56; l_56:; goto l_57; l_57:; hr = (HkRefreshStatementId((context->Transaction))); if ((FAILED(hr))) { goto l_54; } l_54:; if ((FAILED(hr))) { if (freeRow_62) { HkTableReleaseUnusedRow((( struct HkRow*)rec2_62), (Tables[0]), (context->Transaction)); } SetLineNumberForError((context->ErrorObject), 19); goto l_1; } } yc = (yc + 1); { unsigned char * expr_67 = ((context->DeepDataBuffer) + 0); unsigned short exprl_67 = 0; unsigned char const * hktmp_72; short hktmp_length_72; unsigned char willTargetDestinationBufferRemainTheSame_72 = 1; static unsigned char const hkl_73[] = { 78, 97, 109, 101, 32, 45, 32, 83, 111, 109, 101, 32, 78, 97, 109, 101, }; struct hkt_309576141* rec2_74 = 0; unsigned char freeRow_74 = 0; short rowLength; short varColLength; static wchar_t const hkl_75[] = { 73, 78, 83, 69, 82, 84, }; static wchar_t const hkl_76[] = { 91, 77, 121, 84, 101, 99, 66, 105, 116, 115, 95, 78, 97, 109, 101, 115, 95, 50, 93, }; static wchar_t const hkl_77[] = { 91, 83, 108, 95, 110, 111, 93, }; goto l_71; l_71:; hktmp_length_72 = exprl_67; hktmp_72 = expr_67; exprl_67 = 0; exprl_67 = (exprl_67 + 16); memcpy (expr_67, hkl_73, 16); goto l_70; l_70:; rowLength = sizeof ( struct hkt_309576141); varColLength = 0; varColLength = (varColLength + exprl_67); rowLength = (rowLength + varColLength); hr = (HkRowAlloc((context->Transaction), (Tables[1]), rowLength, (( struct HkRow**)(&rec2_74)))); if ((FAILED(hr))) { goto l_66; } freeRow_74 = 1; if ((! var_isnull_4)) { (rec2_74->hkc_1) = var_4; } else { hr = -2113929186; if ((FAILED(hr))) { { CreateError((context->ErrorObject), hr, 5, 14, hkl_77, 38, hkl_76, hkl_75); } if ((FAILED(hr))) { goto l_66; } } } if ((! var_isnull_5)) { (rec2_74->hkc_2) = var_5; ((rec2_74->null_bits).hkc_isnull_2) = 0; } else { ((rec2_74->null_bits).hkc_isnull_2) = 1; } ((rec2_74->hkvdo)[0]) = sizeof ( struct hkt_309576141); memcpy ((((unsigned char *)rec2_74) + ((rec2_74->hkvdo)[0])), expr_67, exprl_67); ((rec2_74->null_bits).hkc_isnull_3) = 0; ((rec2_74->null_bits).hkc_isnull_3) = 0; ((rec2_74->hkvdo)[1]) = (((rec2_74->hkvdo)[0]) + varColLength); freeRow_74 = 0; hr = (HkTableInsert((Tables[1]), (context->Transaction), (( struct HkRow*)rec2_74))); if ((FAILED(hr))) { goto l_66; } goto l_68; l_68:; goto l_69; l_69:; hr = (HkRefreshStatementId((context->Transaction))); if ((FAILED(hr))) { goto l_66; } l_66:; if ((FAILED(hr))) { if (freeRow_74) { HkTableReleaseUnusedRow((( struct HkRow*)rec2_74), (Tables[1]), (context->Transaction)); } SetLineNumberForError((context->ErrorObject), 20); goto l_1; } } yc = (yc + 1); { __int64 temp_79; if ((! var_isnull_4)) { temp_79 = ((( __int64 )var_4) + (( __int64 )1)); if ((temp_79 < (-2147483647 - 1))) { hr = -2113929211; { hr = (CreateError((context->ErrorObject), hr, 2, 23, 0)); } if ((FAILED(hr))) { goto l_78; } } if ((temp_79 > 2147483647)) { hr = -2113929212; { hr = (CreateError((context->ErrorObject), hr, 2, 23, 0)); } if ((FAILED(hr))) { goto l_78; } } var_4 = (( long )temp_79); var_isnull_4 = 0; } else { var_isnull_4 = 1; } l_78:; if ((FAILED(hr))) { SetLineNumberForError((context->ErrorObject), 21); goto l_1; } } yc = (yc + 1); if ((! 1)) { var_5 = 0; var_isnull_5 = 0; } else { var_isnull_5 = 1; } yc = (yc + 1); } l_46:; } yc = (yc + 1); } } yc = (yc + 1); ((valueArray[0]).SignedIntData) = 0; l_1:; if (cur_13) { HkCursorHashFree(cur_13); } if (cur_29) { HkCursorHashFree(cur_29); } return hr; } struct HkProcInfo ProcInfo = { hkp_421576540, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, TableStabilizeRootTableRows, }; unsigned long TableIdsStabilize[] = { 277576027, 309576141, }; __declspec ( dllexport ) struct HkProcBindings g_Bindings = { 0, 2, TableIds, Tables, 421576540, (&ProcInfo), TableIdsStabilize, }; |
Refer: msdn.