/* SQLite */
"BEGIN",
/* SQLite3 */
- "BEGIN",
- /* Ingres */
- "BEGIN"
-};
+ "BEGIN"};
const char *my_dbi_batch_lock_filename_query[4] = {
/* Mysql */
/* SQLite */
"BEGIN",
/* SQLite3 */
- "BEGIN",
- /* Ingres */
- "BEGIN"
-};
+ "BEGIN"};
const char *my_dbi_batch_unlock_tables_query[4] = {
/* Mysql */
/* SQLite3 */
"INSERT INTO Path (Path)"
" SELECT DISTINCT Path FROM batch"
- " EXCEPT SELECT Path FROM Path",
- /* Ingres */
- "INSERT INTO Path (Path) "
- "SELECT a.Path FROM "
- "(SELECT DISTINCT Path FROM batch) AS a "
- "WHERE NOT EXISTS (SELECT Path FROM Path WHERE Path = a.Path) "
-};
+ " EXCEPT SELECT Path FROM Path"};
const char *my_dbi_batch_fill_filename_query[4] = {
/* Mysql */
/* SQLite3 */
"INSERT INTO Filename (Name)"
" SELECT DISTINCT Name FROM batch "
- " EXCEPT SELECT Name FROM Filename",
- /* Ingres */
- "INSERT INTO Filename (Name) "
- "SELECT a.Name FROM "
- "(SELECT DISTINCT Name FROM batch) as a "
- "WHERE NOT EXISTS "
- "(SELECT Name FROM Filename WHERE Name = a.Name)"
-};
+ " EXCEPT SELECT Name FROM Filename"};
#endif /* HAVE_BATCH_FILE_INSERT */
Dmsg0(500,"my_ingres_query: Start of transaction\n");
mdb->transaction = true;
return 0;
- } else if (strcasecmp(new_query, "COMMIT") != NULL) {
+ } else if (strcasecmp(new_query, "END") != NULL) {
/*
* End of a transaction.
*/
}
#ifdef HAVE_BATCH_FILE_INSERT
-const char *my_ingres_batch_lock_path_query = "BEGIN";
+const char *my_ingres_batch_lock_path_query =
+ "BEGIN; LOCK TABLE Path IN SHARE ROW EXCLUSIVE MODE";
-const char *my_ingres_batch_lock_filename_query = "BEGIN";
+
+const char *my_ingres_batch_lock_filename_query =
+ "BEGIN; LOCK TABLE Filename IN SHARE ROW EXCLUSIVE MODE";
const char *my_ingres_batch_unlock_tables_query = "COMMIT";