Index: ChangeLog =================================================================== --- ChangeLog (revision 466) +++ ChangeLog (working copy) @@ -5,6 +5,9 @@ but must be enabled through configuration files or the DSN. (Bug #12918) Bugs fixed: + * SQL_C_TYPE_DATE, SQL_C_TYPE_TIME, and SQL_C_TYPE_TIMESTAMP were formatted + without seperators, which could cause them to get interpreted incorrectly + in some cases due to server bugs. (Bug #15773) * Calls to SQLNativeSql could cause stack corruption due to an incorrect pointer cast. (Bug #28758) * SQLSetPos could update or delete the wrong rows when the original result Index: driver/execute.c =================================================================== --- driver/execute.c (revision 466) +++ driver/execute.c (working copy) @@ -444,28 +444,31 @@ case SQL_C_TYPE_DATE: { DATE_STRUCT *date= (DATE_STRUCT*) data; - sprintf(buff,"%04d%02d%02d",date->year,date->month,date->day); + sprintf(buff, "%04d-%02d-%02d", + date->year, date->month, date->day); data= buff; - length= 8; + length= 10; break; } case SQL_C_TIME: case SQL_C_TYPE_TIME: { TIME_STRUCT *time= (TIME_STRUCT*) data; - sprintf(buff,"%02d%02d%02d",time->hour,time->minute,time->second); + sprintf(buff, "%02d:%02d:%02d", + time->hour, time->minute, time->second); data= buff; - length= 6; + length= 8; break; } case SQL_C_TIMESTAMP: case SQL_C_TYPE_TIMESTAMP: { TIMESTAMP_STRUCT *time= (TIMESTAMP_STRUCT*) data; - sprintf(buff,"%04d%02d%02d%02d%02d%02d",time->year,time->month,time->day, - time->hour,time->minute,time->second); + sprintf(buff, "%04d-%02d-%02d %02d:%02d:%02d", + time->year, time->month, time->day, + time->hour, time->minute, time->second); data= buff; - length= 14; + length= 19; break; } } Index: test/my_datetime.c =================================================================== --- test/my_datetime.c (revision 477) +++ test/my_datetime.c (working copy) @@ -694,7 +694,7 @@ ADD_TEST(t_time) ADD_TEST(t_time1) ADD_TEST(t_bug12520) - ADD_TODO(t_bug15773) + ADD_TEST(t_bug15773) END_TESTS