strcmp("pg_catalog", strVal(linitial(typename->names))) == 0 &&
strcmp(name, strVal(lsecond(typename->names))) == 0)
return true;
-
+ else if (list_length(typename->names) == 1 &&
+ strcmp(name, strVal(linitial(typename->names))) == 0)
+ return true;
return false;
}
SELECT * FROM explain_analyze;
SELECT CURRENT_TIMESTAMP;
SELECT CURRENT_USER;
+SELECT '2022-07-05 10:00:00'::TIMESTAMP;
+SELECT '2022-07-05 10:00:00'::TIMESTAMP;
+SELECT '2022-07-05 10:00:00'::TIME;
+SELECT '2022-07-05 10:00:00'::TIME;
+SELECT '2022-07-05 10:00:00'::DATE;
+SELECT '2022-07-05 10:00:00'::DATE;
+SELECT '2022-07-05 10:00:00'::TIMESTAMPTZ;
+SELECT '2022-07-05 10:00:00'::TIMESTAMPTZ;
+SELECT '2022-07-05 10:00:00'::TIMETZ;
+SELECT '2022-07-05 10:00:00'::TIMETZ;
EOF
success=true
grep "fetched from cache" log/pgpool.log | grep explain_analyze > /dev/null && success=false
grep "fetched from cache" log/pgpool.log | grep CURRENT_TIMESTAMP > /dev/null && success=false
grep "fetched from cache" log/pgpool.log | grep CURRENT_USER > /dev/null && success=false
+ grep "fetched from cache" log/pgpool.log | grep 'TIMESTAMP;' > /dev/null || success=false
+ grep "fetched from cache" log/pgpool.log | grep 'TIME;' > /dev/null || success=false
+ grep "fetched from cache" log/pgpool.log | grep 'DATE;' > /dev/null || success=false
+ grep "fetched from cache" log/pgpool.log | grep 'TIMESTAMPTZ;' > /dev/null && success=false
+ grep "fetched from cache" log/pgpool.log | grep 'TIMETZ;' > /dev/null && success=false
+
if [ $success = false ];then
./shutdownall
exit 1
* "SELECT '2022-07-04 09:00:00'::TIMESTAMP" could be regarded as
* non-cachable for example. But there's nothing we can do here.
*/
-#ifdef NOT_USED
- else if (IsA(node, TypeCast) && PG
+ else if (IsA(node, TypeCast))
{
- /* CURRENT_DATE, CURRENT_TIME, LOCALTIMESTAMP, LOCALTIME etc. */
+ /* TIMESTAMP WITH TIME ZONE and TIME WITH TIME ZONE should not be cached. */
TypeCast *tc = (TypeCast *) node;
- if ((isSystemType((Node *) tc->typeName, "date") ||
- isSystemType((Node *) tc->typeName, "timestamp") ||
- isSystemType((Node *) tc->typeName, "timestamptz") ||
- isSystemType((Node *) tc->typeName, "time") ||
- isSystemType((Node *) tc->typeName, "timetz")))
+ if (isSystemType((Node *) tc->typeName, "timestamptz") ||
+ isSystemType((Node *) tc->typeName, "timetz"))
{
ctx->has_non_immutable_function_call = true;
return false;
}
}
-#endif
else if (IsA(node, SQLValueFunction))
{
/*