Skip to content

Fix panic preparing an INSERT with bare parameters into a Dolt system table - #3905

Closed
macneale4 wants to merge 2 commits into
mainfrom
macneale4/brimleylabs--prepared-insert-systable
Closed

macneale4 wants to merge 2 commits into
mainfrom
macneale4/brimleylabs--prepared-insert-systable

Conversation

@macneale4

@macneale4 macneale4 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Preparing an INSERT into a Dolt system table with bare $N parameters panicked in AssignInsertCasts because the parameter took a GMS type. GMS-typed sources are now converted to Doltgres types like the destination columns. Takes over #3830.

… table

A bare parameter takes its destination column's type, which is a GMS type for Dolt system tables.
AssignInsertCasts then called String() on a nil type. Convert GMS types the same way the
destination columns are converted, and name the real type in the error.
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
Main PR
Total 42090 42090
Successful 21510 21517
Failures 20580 20573
Partial Successes1 5442 5442
Main PR
Successful 51.1048% 51.1214%
Failures 48.8952% 48.8786%

${\color{red}Regressions (1)}$

random

QUERY:          SELECT random, count(random) FROM RANDOM_TBL
  GROUP BY random HAVING count(random) > 3;
RECEIVED ERROR: expected row count 0 but received 1

${\color{lightgreen}Progressions (8)}$

arrays

QUERY: insert into src
  select string_agg(random()::text,'') from generate_series(1,10000);

brin

QUERY: WITH rand_value AS (SELECT string_agg(md5(i::text),'') AS val FROM generate_series(1,60) s(i))
INSERT INTO brintest_3
SELECT val, val, val, val FROM rand_value;
QUERY: WITH rand_value AS (SELECT string_agg(md5((-i)::text),'') AS val FROM generate_series(1,60) s(i))
INSERT INTO brintest_3
SELECT val, val, val, val FROM rand_value;

random

QUERY: INSERT INTO RANDOM_TBL (random)
  SELECT count(*)
  FROM onek WHERE random() < 1.0/10;
QUERY: INSERT INTO RANDOM_TBL (random)
  SELECT count(*)
  FROM onek WHERE random() < 1.0/10;
QUERY: INSERT INTO RANDOM_TBL (random)
  SELECT count(*)
  FROM onek WHERE random() < 1.0/10;

rules

QUERY: insert into rtest_view4 select * from rtest_vview4 where 3 > refcount;
QUERY: select * from rtest_view4 order by a, b;

Footnotes

  1. These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct. ↩

@coffeegoddd

coffeegoddd commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

@macneale4 DOLT

read_tests from_latency to_latency percent_change
covering_index_scan_postgres 2.66 2.61 -1.88
groupby_scan_postgres 80.03 78.6 -1.79
index_join_postgres 2.35 2.39 1.7
index_join_scan_postgres 1.61 1.61 0.0
index_scan_postgres 404.61 411.96 1.82
oltp_point_select 0.41 0.41 0.0
oltp_read_only 7.04 7.04 0.0
select_random_points 0.75 0.75 0.0
select_random_ranges 1.06 1.04 -1.89
table_scan_postgres 411.96 411.96 0.0
types_table_scan_postgres 1013.6 1013.6 0.0
write_tests from_latency to_latency percent_change
oltp_delete_insert_postgres 4.65 4.65 0.0
oltp_insert 2.3 2.3 0.0
oltp_read_write 13.22 13.22 0.0
oltp_update_index 2.57 2.57 0.0
oltp_update_non_index 2.26 2.26 0.0
oltp_write_only 6.09 6.21 1.97
types_delete_insert_postgres 5.18 5.18 0.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@macneale4
macneale4 force-pushed the macneale4/brimleylabs--prepared-insert-systable branch from 71e5591 to bd4b044 Compare November 18, 2026 23:28
@macneale4
macneale4 requested a review from zachmu November 21, 2026 01:00
@zachmu

zachmu commented Nov 24, 2026

Copy link
Copy Markdown
Member

Thanks for this fix! We're building on top of your commits in #3960.

@zachmu zachmu closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants