--- runtime/datetime.c.orig 2026-06-23 11:08:14 UTC +++ runtime/datetime.c @@ -788,18 +788,30 @@ static int formatTimestampToMySQL(struct syslogTime *t pBuf[1] = (ts->year / 100) % 10 + '0'; pBuf[2] = (ts->year / 10) % 10 + '0'; pBuf[3] = ts->year % 10 + '0'; - pBuf[4] = (ts->month / 10) % 10 + '0'; - pBuf[5] = ts->month % 10 + '0'; - pBuf[6] = (ts->day / 10) % 10 + '0'; - pBuf[7] = ts->day % 10 + '0'; - pBuf[8] = (ts->hour / 10) % 10 + '0'; - pBuf[9] = ts->hour % 10 + '0'; - pBuf[10] = (ts->minute / 10) % 10 + '0'; - pBuf[11] = ts->minute % 10 + '0'; - pBuf[12] = (ts->second / 10) % 10 + '0'; - pBuf[13] = ts->second % 10 + '0'; - pBuf[14] = '\0'; - return 15; + pBuf[4] = '-'; + pBuf[5] = (ts->month / 10) % 10 + '0'; + pBuf[6] = ts->month % 10 + '0'; + pBuf[7] = '-'; + pBuf[8] = (ts->day / 10) % 10 + '0'; + pBuf[9] = ts->day % 10 + '0'; + pBuf[10] = ' '; + pBuf[11] = (ts->hour / 10) % 10 + '0'; + pBuf[12] = ts->hour % 10 + '0'; + pBuf[13] = ':'; + pBuf[14] = (ts->minute / 10) % 10 + '0'; + pBuf[15] = ts->minute % 10 + '0'; + pBuf[16] = ':'; + pBuf[17] = (ts->second / 10) % 10 + '0'; + pBuf[18] = ts->second % 10 + '0'; + pBuf[19] = '.'; + pBuf[20] = (ts->secfrac / 100000) % 10 + '0'; + pBuf[21] = (ts->secfrac / 10000) % 10 + '0'; + pBuf[22] = (ts->secfrac / 1000) % 10 + '0'; + pBuf[23] = (ts->secfrac / 100) % 10 + '0'; + pBuf[24] = (ts->secfrac / 10) % 10 + '0'; + pBuf[25] = ts->secfrac % 10 + '0'; + pBuf[26] = '\0'; + return 26; } static int formatTimestampToPgSQL(struct syslogTime *ts, char *pBuf) { @@ -1385,4 +1397,4 @@ ENDObjClassInit(datetime) ENDObjClassInit(datetime) /* vi:set ai: - */ \ No newline at end of file + */ --- runtime/msg.c.orig 2026-06-23 11:08:14 UTC +++ runtime/msg.c @@ -1624,7 +1624,7 @@ const char *getTimeReported(smsg_t *const pM, enum tpl case tplFmtMySQLDate: MsgLock(pM); if (pM->pszTIMESTAMP_MySQL == NULL) { - if ((pM->pszTIMESTAMP_MySQL = malloc(15)) == NULL) { + if ((pM->pszTIMESTAMP_MySQL = malloc(26)) == NULL) { MsgUnlock(pM); return ""; }