[no-release-notes] fix tests dropping null checks on not nullable columns#2839
[no-release-notes] fix tests dropping null checks on not nullable columns#2839jycor wants to merge 6 commits into
Conversation
|
|
SummaryOverall, 8 test cases ran with 6 passing and 2 failing: boundary/index regression checks and dependency-upgrade parity validations passed, including stable NULL-exclusive range rendering, correct upgraded module resolution, and fallback join-plan stability. The most important issues were a high-severity runtime join failure ( Tests run by ItoAdditional Findings DetailsThese findings are unrelated to the current changes but were observed during testing. 🟠 Non-hinted join fails on bigint and int32 coercion
🟡 Startup timezone is ignored for TIMESTAMPTZ sessions
Tip Reply with @itoqa to send us feedback on this test run. |
|
Commit: SummaryAcross 8 QA cases, 7 passed: pg_constraint overflow-guard scenarios (max contypid/conrelid and lower-bound variant parity) behaved correctly, null-bound OR-filter behavior matched between EXPLAIN and runtime including nullable-index handling, and the targeted TestBasicIndexing regression command remained stable on upgraded dependencies. Tests run by ItoTip Reply with @itoqa to send us feedback on this test run. |
There was a problem hiding this comment.
Range conversion drops valid constraint rows
What failed: The query returns no rows when six constraint names are expected, and explain output shows open-lower-bound formatting changes alongside the semantic drift.
Impact · Steps · Stub / mock · Analysis · Why this is likely a bug
- Severity: Medium
- Impact: Constraint metadata queries can miss valid rows on this path, which can break expected introspection behavior for affected workloads. The issue is persistent but scoped to a specific index-range conversion flow.
- Steps to Reproduce:
- Build and run the repository with the upgraded dependency set from this PR.
- Execute
go test ./testing/go -run TestPgConstraintIndexes --count=1. - Inspect the assertion for
SELECT conname FROM pg_catalog.pg_constraint WHERE (conname LIKE '%_pkey' OR conname LIKE '%_key') AND connamespace = 2200 ORDER BY conname. - Observe that no rows are returned where six constraint names are expected.
- Stub / mock content: Real SCRAM sign-in was bypassed by turning off the auth gate in
server/authentication_scram.goso the regression failure could be reproduced consistently in the local QA environment. - Code Analysis: I inspected
server/tables/pgcatalog/pg_constraint.goand verified that thepg_constraint_conname_nsp_indexupper-bound logic increments schema upper bounds while leavingconNameUpperempty, then uses that as the less-than key. With the same file's(conname, schema)comparator ordering, this upper key can sort below normal names and exclude valid rows. - Why this is likely a bug: The production range-bound construction and comparator order together provide a concrete code path that explains the observed empty-result regression for a valid query.
Relevant code
server/tables/pgcatalog/pg_constraint.go:344-354
if conNameRange.HasUpperBound() || schemaOidRange.HasUpperBound() {
// our less-than upper bound depends on whether we have a prefix match or both fields were set
if !schemaOidUpperSet {
conNameUpper = fmt.Sprintf("%s%o", conNameUpper, rune(0))
} else {
schemaOidUpper = schemaOidUpper + 1
}
lt = &pgConstraint{
name: conNameUpper,
schemaOidNative: schemaOidUpper,
}
}server/tables/pgcatalog/pg_constraint.go:578-583
func lessConstraintNameSchema(a, b []*pgConstraint) bool {
if a[0].name == b[0].name {
return a[0].schemaOidNative < b[0].schemaOidNative
}
return a[0].name < b[0].name
}Copy prompt for an agent
Ito QA identified the following failure during automated PR testing. Please investigate and propose a fix.
**Medium severity — Range conversion drops valid constraint rows**
**What failed:** The query returns no rows when six constraint names are expected, and explain output shows open-lower-bound formatting changes alongside the semantic drift.
- **Impact:** Constraint metadata queries can miss valid rows on this path, which can break expected introspection behavior for affected workloads. The issue is persistent but scoped to a specific index-range conversion flow.
- **Steps to reproduce:**
1. Build and run the repository with the upgraded dependency set from this PR.
2. Execute `go test ./testing/go -run TestPgConstraintIndexes --count=1`.
3. Inspect the assertion for `SELECT conname FROM pg_catalog.pg_constraint WHERE (conname LIKE '%_pkey' OR conname LIKE '%_key') AND connamespace = 2200 ORDER BY conname`.
4. Observe that no rows are returned where six constraint names are expected.
- **Stub / mock content:** Real SCRAM sign-in was bypassed by turning off the auth gate in `server/authentication_scram.go` so the regression failure could be reproduced consistently in the local QA environment.
- **Code analysis:** I inspected `server/tables/pgcatalog/pg_constraint.go` and verified that the `pg_constraint_conname_nsp_index` upper-bound logic increments schema upper bounds while leaving `conNameUpper` empty, then uses that as the less-than key. With the same file's `(conname, schema)` comparator ordering, this upper key can sort below normal names and exclude valid rows.
- **Why this is likely a bug:** The production range-bound construction and comparator order together provide a concrete code path that explains the observed empty-result regression for a valid query.
**Relevant code:**
`server/tables/pgcatalog/pg_constraint.go:344-354`
~~~go
if conNameRange.HasUpperBound() || schemaOidRange.HasUpperBound() {
// our less-than upper bound depends on whether we have a prefix match or both fields were set
if !schemaOidUpperSet {
conNameUpper = fmt.Sprintf("%s%o", conNameUpper, rune(0))
} else {
schemaOidUpper = schemaOidUpper + 1
}
lt = &pgConstraint{
name: conNameUpper,
schemaOidNative: schemaOidUpper,
}
}
~~~
`server/tables/pgcatalog/pg_constraint.go:578-583`
~~~go
func lessConstraintNameSchema(a, b []*pgConstraint) bool {
if a[0].name == b[0].name {
return a[0].schemaOidNative < b[0].schemaOidNative
}
return a[0].name < b[0].name
}
~~~
Commit: SummaryOverall, 10 of 13 tests passed, confirming that max-uint32 pg_constraint boundary handling (no wraparound, range-restricted index access, and terminal composite-key row preservation) and all EXPLAIN-notation/semantic regression checks behaved correctly in local verification. The key issue is 3 medium-severity failures showing a real pg_constraint range-conversion and iterator-routing bug—especially with disjoint OR and mixed/edge bounds—where concrete bounds can be built but bound flags remain unsynchronized, causing incorrect EOF routing and empty results instead of expected rows. Tests run by ItoAdditional Findings DetailsThese findings are unrelated to the current changes but were observed during testing. 🟡 Disjoint OR range scan drops expected constraint rows
🟡 Bound pair mismatch can force premature EOF
🟡 Null boundary routing selects wrong iterator path
Tip Reply with @itoqa to send us feedback on this test run. |



Depends on dolthub/go-mysql-server#3583