Index: src/date.c ================================================================== --- src/date.c +++ src/date.c @@ -481,11 +481,11 @@ t = (time_t)(x.iJD/1000 - 21086676*(i64)10000); #ifdef HAVE_LOCALTIME_R { struct tm sLocal; if( 0==osLocaltime_r(&t, &sLocal) ){ - sqlite3_result_error(pCtx, "error in localtime_r()", -1); + sqlite3_result_error(pCtx, "local time unavailable", -1); *pRc = SQLITE_ERROR; return 0; } y.Y = sLocal.tm_year + 1900; y.M = sLocal.tm_mon + 1; @@ -496,11 +496,11 @@ } #elif defined(HAVE_LOCALTIME_S) && HAVE_LOCALTIME_S { struct tm sLocal; if( 0!=osLocaltime_s(&sLocal, &t) ){ - sqlite3_result_error(pCtx, "error in localtime_s()", -1); + sqlite3_result_error(pCtx, "local time unavailable", -1); *pRc = SQLITE_ERROR; return 0; } y.Y = sLocal.tm_year + 1900; y.M = sLocal.tm_mon + 1; @@ -522,11 +522,11 @@ y.m = pTm->tm_min; y.s = pTm->tm_sec; } sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER)); if( !pTm ){ - sqlite3_result_error(pCtx, "error in localtime()", -1); + sqlite3_result_error(pCtx, "local time unavailable", -1); *pRc = SQLITE_ERROR; return 0; } } #endif Index: test/tkt-bd484a090c.test ================================================================== --- test/tkt-bd484a090c.test +++ test/tkt-bd484a090c.test @@ -25,18 +25,14 @@ } {0} sqlite3_test_control SQLITE_TESTCTRL_LOCALTIME_FAULT 1 do_test 2.1 { - foreach {rc msg} [catchsql { SELECT datetime('now', 'localtime') }] {} - set res [string match {error in localtime*()} $msg] - list $rc $res -} {1 1} + catchsql { SELECT datetime('now', 'localtime') } +} {1 {local time unavailable}} do_test 2.2 { - foreach {rc msg} [catchsql { SELECT datetime('now', 'utc') }] {} - set res [string match {error in localtime*()} $msg] - list $rc $res -} {1 1} + catchsql { SELECT datetime('now', 'utc') } +} {1 {local time unavailable}} sqlite3_test_control SQLITE_TESTCTRL_LOCALTIME_FAULT 0 finish_test