Skip to content

Fix nil pointer panic in workspace table Update and Delete methods#10590

Merged
jycor merged 1 commit intodolthub:mainfrom
nullun:fix-workspace-table-nil-panic
Mar 2, 2026
Merged

Fix nil pointer panic in workspace table Update and Delete methods#10590
jycor merged 1 commit intodolthub:mainfrom
nullun:fix-workspace-table-nil-panic

Conversation

@nullun
Copy link
Copy Markdown
Contributor

@nullun nullun commented Feb 27, 2026

When StatementBegin encounters an error (e.g., table not found in staging root), it stores the error in wtu.err but leaves tableWriter as nil. The Update and Delete methods were dereferencing tableWriter before checking if it was nil, causing a panic.

This fix adds an early return to check for errors from StatementBegin before attempting to use tableWriter, preventing the nil pointer dereference.

When StatementBegin encounters an error (e.g., table not found in staging
root), it stores the error in wtu.err but leaves tableWriter as nil. The
Update and Delete methods were dereferencing tableWriter before checking
if it was nil, causing a panic.

This fix adds an early return to check for errors from StatementBegin
before attempting to use tableWriter, preventing the nil pointer
dereference.
@jycor
Copy link
Copy Markdown
Contributor

jycor commented Feb 27, 2026

@nullun Thank for your the contribution.
The change looks good, but do you have a way to reproduce the panic?

@nullun
Copy link
Copy Markdown
Contributor Author

nullun commented Feb 27, 2026

@nullun Thank for your the contribution. The change looks good, but do you have a way to reproduce the panic?

It happens when doing dolt add -p on a table that only exists in working. It's what lead me on to my other PR (#10591), but I thought it would be better to keep this small fix on its own.

Copy link
Copy Markdown
Contributor

@jycor jycor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jycor jycor merged commit 1912c5a into dolthub:main Mar 2, 2026
34 of 42 checks passed
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 2, 2026

@coffeegoddd DOLT

test_name detail row_cnt sorted mysql_time sql_mult cli_mult
batching LOAD DATA 10000 1 0.05 2
batching batch sql 10000 1 0.06 2.17
batching by line sql 10000 1 0.06 2
blob 1 blob 200000 1 0.88 4.25 4.31
blob 2 blobs 200000 1 0.86 4.77 4.66
blob no blob 200000 1 0.88 2.77 2.58
col type datetime 200000 1 0.81 2.63 2.46
col type varchar 200000 1 0.67 4 3.91
config width 2 cols 200000 1 0.74 2.77 2.62
config width 32 cols 200000 1 1.72 3.45 3.02
config width 8 cols 200000 1 0.96 2.89 3.05
pk type float 200000 1 0.82 2.59 2.6
pk type int 200000 1 0.79 2.62 2.41
pk type varchar 200000 1 1.56 1.63 2.09
row count 1.6mm 1600000 1 5.77 2.91 2.69
row count 400k 400000 1 1.42 2.91 2.71
row count 800k 800000 1 2.92 2.87 2.64
secondary index four index 200000 1 3.4 1.37 1.12
secondary index no secondary 200000 1 0.88 2.77 2.58
secondary index one index 200000 1 1.08 2.63 2.31
secondary index two index 200000 1 1.87 1.86 1.68
sorting shuffled 1mm 1000000 0 5.4 2.88 2.78
sorting sorted 1mm 1000000 1 5.49 2.85 2.77

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 2, 2026

@coffeegoddd DOLT

name detail mean_mult
dolt_blame_basic system table 1.25
dolt_blame_commit_filter system table 1.19
dolt_commit_ancestors_commit_filter system table 0.61
dolt_commits_commit_filter system table 1.05
dolt_diff_log_join_from_commit system table 2.92
dolt_diff_log_join_to_commit system table 2.91
dolt_diff_table_from_commit_filter system table 1.22
dolt_diff_table_to_commit_filter system table 1.25
dolt_diffs_commit_filter system table 1.03
dolt_history_commit_filter system table 1.48
dolt_log_commit_filter system table 1.1

DreadPirateRobertz added a commit to DreadPirateRobertz/gastown that referenced this pull request Mar 7, 2026
Dolt v1.83.1 includes dolthub/dolt#10590 which fixes nil pointer panics
in workspace table Update/Delete methods when StatementBegin encounters
errors. Updates MinDoltVersion constant, Dockerfile, and all docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DreadPirateRobertz added a commit to DreadPirateRobertz/gastown that referenced this pull request Mar 8, 2026
Dolt v1.83.1 includes dolthub/dolt#10590 which fixes nil pointer panics
in workspace table Update/Delete methods when StatementBegin encounters
errors. Updates MinDoltVersion constant, Dockerfile, and all docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DreadPirateRobertz added a commit to DreadPirateRobertz/gastown that referenced this pull request Mar 8, 2026
Dolt v1.83.1 includes dolthub/dolt#10590 which fixes nil pointer panics
in workspace table Update/Delete methods when StatementBegin encounters
errors. Updates MinDoltVersion constant, Dockerfile, and all docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants