Skip to content

fix(test): resolve parameter type inconsistency in HNSW semantics test - #218

Merged
waterbro-8 merged 1 commit into
bytefolk:codex/fix-pr-180from
sun-970:fix/pr-197-test-type-error
Sep 17, 2026
Merged

waterbro-8 merged 1 commit into
bytefolk:codex/fix-pr-180from
sun-970:fix/pr-197-test-type-error

Conversation

@sun-970

@sun-970 sun-970 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Refs #197

Fixes the failing PostgreSQL integration test in #197.

Problem

TestTextANNFileSemanticsPostgres fails with:

ERROR: inconsistent types deduced for parameter $1 (SQLSTATE 42P08)

The test SQL uses $1::text to cast a UUID parameter to text for the storage_key column, but $1 is already used as a UUID in the first position. PostgreSQL cannot deduce a consistent type for the parameter.

Solution

Use separate parameters for the UUID and its text representation instead of casting:

-- Before:
VALUES($1,$2,'fixture', $3,0,'fixture',$4,$1::text,$5,$5)

-- After:
VALUES($1,$2,'fixture',$3,0,'fixture',$4,$5,$6,$6)

Where $5 is id.String() (the text representation) and $6 is the timestamp.

Validation

This is a minimal fix for the test infrastructure, not a change to the HNSW migration or search logic.

Use separate parameters for UUID and text representation instead of
casting $1::text, which caused PostgreSQL to fail type deduction.

@waterbro-8 waterbro-8 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The $1::text reuse is a real PostgreSQL 42P08. Splitting the UUID and its text form into $1 / $5 is the right fix, and it matches the failure on #197 (TestTextANNFileSemanticsPostgres). One-file test change, no production SQL.

CI title check needed Refs #197 in the body; that is now present. Merge into codex/fix-pr-180 once the title/link job is green.

@waterbro-8
waterbro-8 merged commit 4536392 into bytefolk:codex/fix-pr-180 Sep 17, 2026
21 of 22 checks passed
waterbro-8 pushed a commit that referenced this pull request Sep 18, 2026
#218)

Refs #197

Fixes the failing PostgreSQL integration test in #197.

## Problem

`TestTextANNFileSemanticsPostgres` fails with:
```
ERROR: inconsistent types deduced for parameter $1 (SQLSTATE 42P08)
```

The test SQL uses `$1::text` to cast a UUID parameter to text for the
`storage_key` column, but `$1` is already used as a UUID in the first
position. PostgreSQL cannot deduce a consistent type for the parameter.

## Solution

Use separate parameters for the UUID and its text representation instead
of casting:
```sql
-- Before:
VALUES($1,$2,'fixture', $3,0,'fixture',$4,$1::text,$5,$5)

-- After:
VALUES($1,$2,'fixture',$3,0,'fixture',$4,$5,$6,$6)
```

Where `$5` is `id.String()` (the text representation) and `$6` is the
timestamp.

## Validation

- [x] Fix resolves the type deduction error
- [ ] CI passes on this PR
- [ ] Can be cherry-picked into #197

This is a minimal fix for the test infrastructure, not a change to the
HNSW migration or search logic.

Co-authored-by: liyuanyang <liyuanyang@users.noreply.github.com>
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.

3 participants