"~"
};
+static const char *insert_counter_values_default =
+ "INSERT INTO Counters (Counter, MinValue, "
+ "MaxValue, CurrentValue, WrapCounter) "
+ "VALUES ('%s','%d','%d','%d','%s')";
+
+const char *insert_counter_values[] = {
+ /* Mysql */
+ "INSERT INTO Counters (Counter, Counters.MinValue, "
+ "Counters.MaxValue, CurrentValue, WrapCounter) "
+ "VALUES ('%s','%d','%d','%d','%s')",
+
+ /* Postgresql */
+ insert_counter_values_default,
+
+ /* SQLite3 */
+ insert_counter_values_default,
+
+ /* Ingres */
+ insert_counter_values_default
+};
+
static const char *select_counter_values_default =
"SELECT MinValue, MaxValue, CurrentValue, WrapCounter "
"FROM Counters WHERE Counter='%s'";
extern const char CATS_IMP_EXP *batch_fill_path_query[];
extern const char CATS_IMP_EXP *batch_fill_filename_query[];
extern const char CATS_IMP_EXP *match_query[];
+extern const char CATS_IMP_EXP *insert_counter_values[];
extern const char CATS_IMP_EXP *select_counter_values[];
extern const char CATS_IMP_EXP *update_counter_values[];
return 1;
}
mdb->db_escape_string(jcr, esc, cr->Counter, strlen(cr->Counter));
+
/* Must create it */
- Mmsg(mdb->cmd, "INSERT INTO Counters (Counter,Counters.MinValue,Counters.MaxValue,CurrentValue,"
- "WrapCounter) VALUES ('%s','%d','%d','%d','%s')",
+ Mmsg(mdb->cmd, insert_counter_values[db_get_type_index(mdb)],
esc, cr->MinValue, cr->MaxValue, cr->CurrentValue,
cr->WrapCounter);
return stat;
}
-
/**
* Create a FileSet record. This record is unique in the
* name and the MD5 signature of the include/exclude sets.