test no-op layout string#2805
Conversation
|
Ito Test Report ❌12 test cases ran. 4 failed, 8 passed. Overall, the unified run failed with 12 total tests (8 passed, 4 failed) and confirmed PR-introduced production defects centered on DateStyle handling, including medium-severity contract drift and a high-severity legacy compatibility regression. The key finding is that startup/session DateStyle negotiation and input parsing still accept and honor non-ISO styles (SQL/Postgres/German, MDY/DMY/YMD), but temporal text output paths are hardcoded to ISO (via getLayoutStringFormat used by date_out/timestamp_out), which breaks round-trip and strict parser expectations for DateStyle-aware clients even though binary encoding and mixed binary-text semantic values remained stable. ❌ Failed (4)🟠 DateStyle round-trip contract breaks between input and output
Relevant code:
Callable: func(ctx *sql.Context, _ [2]*pgtypes.DoltgresType, val any) (any, error) {
input := val.(string)
formatsInOrder := getDateStyleInputFormat(ctx)
var date pgdate.Date
var err error
for _, format := range formatsInOrder {
date, _, err = pgdate.ParseDate(time.Now(), format, input)
if err == nil {
return date.ToTime()
}
}
return nil, err
},
func getLayoutStringFormat(ctx *sql.Context, dateOnly bool) string {
//layout := getDateStyleOutputFormat(ctx)
//switch layout {
//case DateStyleISO:
// ... DateStyle-specific branches commented out ...
//}
// shouldn't happen but return default
if dateOnly {
return dateStyleFormatDateOnly_ISO
}
return dateStyleFormat_ISO
}
Callable: func(ctx *sql.Context, _ [2]*pgtypes.DoltgresType, val any) (any, error) {
return FormatDateTimeWithBC(val.(time.Time), getLayoutStringFormat(ctx, true), false), nil
},🟠 DateStyle metadata and payload contract drift
Relevant code:
func (h *ConnectionHandler) chooseInitialParameters(startupMessage *pgproto3.StartupMessage) error {
for name, value := range startupMessage.Parameters {
switch strings.ToLower(name) {
case "datestyle":
err := h.doltgresHandler.InitSessionParameterDefault(context.Background(), h.mysqlConn, "DateStyle", value)
if err != nil {
return err
}
}
}
func getLayoutStringFormat(ctx *sql.Context, dateOnly bool) string {
//layout := getDateStyleOutputFormat(ctx)
//switch layout {
//case DateStyleISO:
// ... SQL/Postgres/German branches commented out ...
//}
if dateOnly {
return dateStyleFormatDateOnly_ISO
}
return dateStyleFormat_ISO
}
values := strings.Split(strings.ReplaceAll(strings.ToLower(newVal), " ", ""), ",")
for _, value := range values {
switch value {
case "iso":
ds = "ISO"
case "sql":
ds = "SQL"
case "postgres":
ds = "Postgres"
case "german":
ds = "German"
|
|












No description provided.