userver icon indicating copy to clipboard operation
userver copied to clipboard

Success parse of pg text to cpp integer

Open dsaa27 opened this issue 2 years ago • 0 comments

branch develop, commit 1d0bafae7f093ccf653a490fb5fb59b6f2b0fa99

I expected to see a parsing error but this test passed:

  pg::ResultSet res{nullptr};
  UEXPECT_NO_THROW(res = GetConn()->Execute("select '40'::text"));

  int tgt_int = 0;
  const int expected_int = 0x3430;
  UEXPECT_NO_THROW(res[0][0].To(tgt_int));
  EXPECT_EQ(tgt_int, expected_int);

dsaa27 avatar Aug 20 '23 16:08 dsaa27