agu-z / roc-pg

🐘 Use PostgreSQL databases from Roc
Universal Permissive License v1.0
41 stars 5 forks source link

`ErrorResponse` message is failing to decode #1

Open agu-z opened 1 year ago

agu-z commented 1 year ago

TCP dump of an error that failed to decode:

4500 00f3 0000 4000 4006 0000 7f00 0001  E.....@.@.......
7f00 0001 1538 c969 5d5e 99e1 ab26 0f7a  .....8.i]^...&.z
8018 18e9 fee7 0000 0101 080a c7e5 05c0  ................
26ba 4ed6 4500 0000 be53 4552 524f 5200  &.N.E....SERROR.
5645 5252 4f52 0043 3432 3732 3500 4d6f  VERROR.C42725.Mo
7065 7261 746f 7220 6973 206e 6f74 2075  perator.is.not.u
6e69 7175 653a 2075 6e6b 6e6f 776e 202b  nique:.unknown.+
2075 6e6b 6e6f 776e 0048 436f 756c 6420  .unknown.HCould.
6e6f 7420 6368 6f6f 7365 2061 2062 6573  not.choose.a.bes
7420 6361 6e64 6964 6174 6520 6f70 6572  t.candidate.oper
6174 6f72 2e20 596f 7520 6d69 6768 7420  ator..You.might.
6e65 6564 2074 6f20 6164 6420 6578 706c  need.to.add.expl
6963 6974 2074 7970 6520 6361 7374 732e  icit.type.casts.
0050 3131 0046 7061 7273 655f 6f70 6572  .P11.Fparse_oper
2e63 004c 3634 3500 526f 705f 6572 726f  .c.L645.Rop_erro
7200 00
agu-z commented 1 year ago

Another case:

0000: 4500 0000 6f53 4552 524f 5200 5645 5252 4f52 0043 3432 5030 3100 4d72 656c 6174  E...oSERROR.VERROR.C42P01.Mrelat
0020: 696f 6e20 2270 7562 6c69 632e 7573 6572 7322 2064 6f65 7320 6e6f 7420 6578 6973  ion "public.users" does not exis
0040: 7400 5032 3000 4670 6172 7365 5f72 656c 6174 696f 6e2e 6300 4c31 3337 3400 5270  t.P20.Fparse_relation.c.L1374.Rp
0060: 6172 7365 724f 7065 6e54 6162 6c65 0000                                          arserOpenTable..

In this case, it seems the Dict in knownStrFields returns KeyNotFound for keys it definitely has.