The columns BYTEARRAY_ID, DOUBLE, TEXT and TEXT2 are all empty. The column LONG has values (0 for false, 1 for true) if VAR_TYPE is boolean, otherwise it is also empty. TASK_ID is also empty. All other columns are complete.
This is the case when history level is activity, audit or full. I can't use none as I get an warning "In order to use comments, history should be enabled" (I have made quite a few changes to the Explorer module)
The issue I was trying to address was to remove sensitive information from the database at the end of a process execution. I hoped to do this by setting all the relevent variables to an empty string and having history level set at activity. The old values were still in ACT_HI_DETAIL though.
I have now worked out (with a little help from my friend) how to query the database from a JavaDelegate class and delete the necessary data that way, using the following code.
String processId = execution.getProcessInstanceId();
ManagementService m = execution.getEngineServices().getManagementService();
String tableName = m.getTableName(HistoricDetail.class);
String baseQuerySql = "DELETE FROM " + tableName + " WHERE PROC_INST_ID_=" + processId + " "
+ "AND NAME_ IN('firstName','lastName','address')" + ";";
HistoryService h = execution.getEngineServices().getHistoryService();
h.createNativeHistoricVariableInstanceQuery().sql(baseQuerySql).list();
In order to delete the same data, when it was used in a called subprocess, I got that process's ProcessInstanceId as a variable and used that in a second query.
So as long as the values in ACT_HI_VARINST remain missing, I'm OK! Maybe I should include a query to delete them too, just to be safe.