【issue I961B8 】AGE hook不被用户正确加载导致经常性的数据不完整修改

This commit is contained in:
liuyang
2024-03-18 20:18:22 +08:00
committed by yaoxin
parent 3fa4361f63
commit 4e9a5b43ba

View File

@ -973,6 +973,14 @@ bool IsFileExisted(const char *filename)
return file_exists(fullname);
}
#define APACEH_AGE "age"
void InitAGESqlPluginHookIfNeeded()
{
if (get_extension_oid(APACEH_AGE, true) != InvalidOid && IsFileExisted(APACEH_AGE)) {
load_file(APACEH_AGE, !superuser());
}
}
#define INIT_PLUGIN_OBJECT "init_plugin_object"
#define WHALE "whale"
#define DOLPHIN "dolphin"
@ -7735,6 +7743,11 @@ void LoadSqlPlugin()
} else if (u_sess->proc_cxt.MyDatabaseId != InvalidOid && DB_IS_CMPT(A_FORMAT) && u_sess->attr.attr_sql.whale) {
InitASqlPluginHookIfNeeded();
}
/* load age if the age extension been created and the age.o file exists */
if(u_sess->proc_cxt.MyDatabaseId != InvalidOid ){
InitAGESqlPluginHookIfNeeded();
}
}
#endif