AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 36 Bitcoin

sqldb/v2: fix postgres time rewrite

Public commit record

What the developer wrote

Authored by yyforyongyu

78/100 · Adequate
sqldb/v2: fix postgres time rewrite

Keep the Postgres schema rewrite keyed on " TIMESTAMP" so
CURRENT_TIMESTAMP is not rewritten while schema files are
adapted.

Add a focused unit test to keep the replacement aligned with the
existing v1 behavior.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a bug in how LND adapts its SQLite-style database schema for PostgreSQL. Previously, the word 'TIMESTAMP' was being replaced anywhere it appeared, which meant 'CURRENT_TIMESTAMP' could be mangled into 'CURRENT_TIMESTAMP WITHOUT TIME ZONE' and break database migrations. The fix makes the replacement only trigger when 'TIMESTAMP' appears as a standalone column type (with a leading space). A unit test was added to prevent regression.

Recommended action

Treat as a low-severity correctness fix. Ensure deployments running PostgreSQL-backed LND include this patch before applying any schema migrations that reference CURRENT_TIMESTAMP. No immediate emergency response is warranted, but the fix should be included in the next maintenance release.

Security signals we found

01

Database schema migration correctness bug

02

Potential migration failure or data-definition corruption

03

Keyword-substring replacement hazard

04

Regression test added

Risk score

Why this scored 36/100

Our methodology →
Potential impact 8/30
Exploitability 4/25
Stealth signal 6/15
Affected reach 7/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.