Commit 84babbf
committed
guid: cover VARBINARY wire, fix its varying-prefix crash, drop dead arms
Test coverage:
- BindGuidToVarcharOctets16 — binds SQL_C_GUID to VARCHAR(16) CHARACTER
SET OCTETS (the wire form of native FB4+ VARBINARY(16)). The existing
BindGuidToCharOctets16 only covered the fixed CHAR(16) (SQL_TEXT) slot;
this exercises the SQL_VARYING (length-prefixed) binary wire, which was
previously untested.
Bug the new test exposed (and fixes):
- For a SQL_VARYING binary wire, convGuidToBinary wrote 16 raw bytes at
offset 0 with no 2-byte length prefix. Firebird then read the first
GUID bytes as a VARYING length and over-read the buffer — a hard
SEGFAULT on the FB6 snapshot (silently tolerated on FB5). The dispatch
now calls setTypeText() for the OCTETS subtype-1/len-16 branch, mirroring
the text branch: the varying wire becomes fixed SQL_TEXT (OCTETS charset
preserved) so the offset-0 write is correct. A fixed CHAR(16) wire is
already SQL_TEXT, so this is a no-op there.
- The new test is SKIP_ON_FIREBIRD6-guarded: even with the prefix fix, the
current FB6 master snapshot aborts this parameterized OCTETS-VARYING
insert with a server-side "Stack overflow" — the same parameterized-query
incompatibility already guarded across the suite. Exercised on FB 3/4/5.
Dead-code removal:
- Drop the wire-side `to->conciseType == SQL_C_BINARY` arm. Native FB4+
BINARY/VARBINARY reach the dispatch as subtype-1 / sqllen-16 OCTETS
(caught by the branch above); the only type that yields conciseType
SQL_C_BINARY is a binary BLOB, not a sane GUID-bind target.
- Drop the app-side `case SQL_C_BINARY` arm. That output direction is
unreachable until column-side SQL_GUID mapping (T5-5 / #287) lands.
convGuidToBinary stays (still used by the OCTETS wire branch). Verified:
all 4 GuidParamBindingTest cases pass on FB 5.0.3; on the FB6 snapshot the
3 non-varying cases pass and the VARBINARY case skips; full suite shows no
regressions.1 parent f08e69e commit 84babbf
2 files changed
Lines changed: 71 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1001 | 1001 | | |
1002 | 1002 | | |
1003 | 1003 | | |
1004 | | - | |
1005 | | - | |
1006 | | - | |
1007 | | - | |
1008 | | - | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
1009 | 1009 | | |
1010 | 1010 | | |
1011 | | - | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
1012 | 1019 | | |
1013 | 1020 | | |
| 1021 | + | |
| 1022 | + | |
1014 | 1023 | | |
1015 | | - | |
1016 | | - | |
1017 | | - | |
| 1024 | + | |
1018 | 1025 | | |
1019 | 1026 | | |
1020 | 1027 | | |
| |||
1031 | 1038 | | |
1032 | 1039 | | |
1033 | 1040 | | |
1034 | | - | |
1035 | | - | |
1036 | 1041 | | |
1037 | 1042 | | |
1038 | 1043 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
608 | 608 | | |
609 | 609 | | |
610 | 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 | + | |
611 | 666 | | |
612 | 667 | | |
613 | 668 | | |
| |||
0 commit comments