pgx/pgtype
Jack Christensen 1d557f9116 Remove PlanScan memoization
Previously, PlanScan used a cache to improve performance. However, the
cache could get confused in certain cases. For example, the following
would fail:

m := pgtype.NewMap()
var err error

var tags any
err = m.Scan(pgtype.TextArrayOID, pgx.TextFormatCode, []byte("{foo,bar,baz}"), &tags)
require.NoError(t, err)

var cells [][]string
err = m.Scan(pgtype.TextArrayOID, pgx.TextFormatCode, []byte("{{foo,bar},{baz,quz}}"), &cells)
require.NoError(t, err)

This commit removes the memoization and adds a test to ensure that this
case works.

The benchmarks were also updated to include an array of strings to
ensure this path is benchmarked. As it turned out, there was next to no
performance difference between the cached and non-cached versions.

It's possible there may be a performance impact in certain complicated
cases, but I have not encountered any. If there are any performance
issues, we can optimize the narrower case rather than adding memoization
everywhere.
2025-05-17 16:34:01 -05:00
..
2022-04-16 14:21:40 -05:00
2022-04-02 14:34:19 -05:00
2022-04-02 14:34:19 -05:00
2022-04-09 09:12:55 -05:00
2022-04-02 14:34:19 -05:00
2022-04-09 09:12:55 -05:00
2022-04-09 09:12:55 -05:00
2023-07-10 20:23:42 -05:00
2024-02-23 18:18:03 -06:00
2023-10-07 09:26:23 -05:00
2025-03-24 15:01:50 +01:00
2025-03-24 15:01:50 +01:00
2022-04-02 14:34:19 -05:00
2022-04-09 09:12:55 -05:00
2022-04-02 14:34:19 -05:00
2022-09-24 10:30:12 -05:00
2024-01-26 09:06:13 -06:00
2024-01-26 09:06:13 -06:00
2024-03-20 18:21:11 -05:00
2022-04-09 09:12:55 -05:00
2022-04-09 09:12:55 -05:00
2022-04-09 09:12:55 -05:00
2025-05-17 16:34:01 -05:00
2025-05-17 16:34:01 -05:00
2025-05-17 16:34:01 -05:00
2022-04-02 14:34:19 -05:00
2023-10-04 20:41:55 +03:00
2022-04-09 09:12:55 -05:00
2022-04-09 09:12:55 -05:00
2022-04-02 14:34:19 -05:00
2022-04-09 09:12:55 -05:00
2022-05-12 17:13:49 -05:00
2022-04-02 14:34:19 -05:00
2023-10-04 20:41:55 +03:00
2024-08-23 16:17:07 -07:00
2024-10-05 10:16:42 -05:00
2024-10-09 14:22:10 +03:00
2024-10-09 14:22:10 +03:00