From: Kern Sibbald Date: Sat, 10 Apr 2010 10:16:28 +0000 (+0200) Subject: Revert "Lets call it COMMIT and not END as that seems to be the counterpart of BEGIN... X-Git-Tag: Release-5.0.2~61 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=761f65477fc4d06ab4556d6a966602a330ba04db;p=bacula%2Fbacula Revert "Lets call it COMMIT and not END as that seems to be the counterpart of BEGIN for transactions." This reverts commit 683329b67a22094295bcc6d50d2852718fe11cd7. --- diff --git a/bacula/src/cats/dbi.c b/bacula/src/cats/dbi.c index dd2a9bba9c..fad2d03fa4 100644 --- a/bacula/src/cats/dbi.c +++ b/bacula/src/cats/dbi.c @@ -1274,10 +1274,7 @@ const char *my_dbi_batch_lock_path_query[4] = { /* SQLite */ "BEGIN", /* SQLite3 */ - "BEGIN", - /* Ingres */ - "BEGIN" -}; + "BEGIN"}; const char *my_dbi_batch_lock_filename_query[4] = { /* Mysql */ @@ -1287,10 +1284,7 @@ const char *my_dbi_batch_lock_filename_query[4] = { /* SQLite */ "BEGIN", /* SQLite3 */ - "BEGIN", - /* Ingres */ - "BEGIN" -}; + "BEGIN"}; const char *my_dbi_batch_unlock_tables_query[4] = { /* Mysql */ @@ -1320,13 +1314,7 @@ const char *my_dbi_batch_fill_path_query[4] = { /* 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 */ @@ -1347,14 +1335,7 @@ const char *my_dbi_batch_fill_filename_query[4] = { /* 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 */ diff --git a/bacula/src/cats/ingres.c b/bacula/src/cats/ingres.c index 9d68edac4e..c8799a7cfd 100755 --- a/bacula/src/cats/ingres.c +++ b/bacula/src/cats/ingres.c @@ -561,7 +561,7 @@ int my_ingres_query(B_DB *mdb, const char *query) 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. */ @@ -776,9 +776,12 @@ char *my_ingres_copy_escape(char *dest, char *src, size_t len) } #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";