sqlString improvements#2781
Conversation
|
Ito Test Report ✅7 test cases ran. 1 additional finding, 6 passed. The unified run passed 6 of 7 TIME-related tests, confirming stable behavior for canonical formatting (including trailing-zero trimming), consistency between pgwire and ::text output paths, exact preservation of 24:00:00, default six-digit fractional precision when typmod is unspecified, and parse-stable high-fanout validation across 14,336 rows with no malformed values. ✅ Passed (6)ℹ️ Additional Findings (1)
🟠 TIME typmod precision casts do not enforce rounding
Relevant code:
typmod := val3.(int32)
if typmod == -1 {
typmod = 6
}
precision := tree.TimeFamilyPrecisionToRoundDuration(typmod)
if strings.EqualFold(input, "now") {
// timetypmodin represents the PostgreSQL function of time type IO typmod input.
var timetypmodin = framework.Function1{
Name: "timetypmodin",
Return: pgtypes.Int32,
Parameters: [1]*pgtypes.DoltgresType{pgtypes.CstringArray},
Strict: true,
Callable: func(ctx *sql.Context, _ [2]*pgtypes.DoltgresType, val any) (any, error) {
// TODO: typmod=(precision<<16)∣scale
return nil, nil
},
}
// timetypmodout represents the PostgreSQL function of time type IO typmod output.
var timetypmodout = framework.Function1{
Name: "timetypmodout",
Return: pgtypes.Cstring,
Parameters: [1]*pgtypes.DoltgresType{pgtypes.Int32},
Strict: true,
Callable: func(ctx *sql.Context, _ [2]*pgtypes.DoltgresType, val any) (any, error) {
// TODO
// Precision = typmod & 0xFFFF
// Scale = (typmod >> 16) & 0xFFFF
return nil, nil
},
}Commit: Tell us how we did: Give Ito Feedback |
|







No description provided.