Skip to content

Commit

Permalink
Merge pull request #1035 from bruno-at-bareos/dev/bruno/bug#1409_drop…
Browse files Browse the repository at this point in the history
…_table_if_exists

core cats: Add `IF EXISTS` in drop table statements
  • Loading branch information
pstorz committed Jan 13, 2022
2 parents 37d2fca + f3c94c9 commit 946bf7d
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,7 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
### Fixed
- debian: Let dbconfig create the Bareos catalog also with LC_COLLATE='C' and LC_CTYPE='C'. The create_bareos_database script did always do so. Requires dbconfig >= 2.0.21 [PR #1031]
- fix wrong `packages_dir` in restapi workflow, so restapi packages will be released to PyPI [PR #1033]
- core cats: Add IF EXISTS in drop table statements fix for bug #1409 (Allow usage of ExitOnFatal) [PR #1035]

### Added
- doc: Add chapter for mariabackup db plugin [PR #1016]
Expand All @@ -27,4 +28,5 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
[PR #1016]: https://github.com/bareos/bareos/pull/1016
[PR #1031]: https://github.com/bareos/bareos/pull/1031
[PR #1033]: https://github.com/bareos/bareos/pull/1033
[PR #1035]: https://github.com/bareos/bareos/pull/1035
[unreleased]: https://github.com/bareos/bareos/tree/master
2 changes: 1 addition & 1 deletion core/src/cats/dml/0018_uar_del_temp
@@ -1 +1 @@
DROP TABLE temp
DROP TABLE IF EXISTS temp
2 changes: 1 addition & 1 deletion core/src/cats/dml/0019_uar_del_temp1
@@ -1 +1 @@
DROP TABLE temp1
DROP TABLE IF EXISTS temp1
4 changes: 2 additions & 2 deletions core/src/cats/mysql_queries.inc
Expand Up @@ -214,11 +214,11 @@ const char *BareosDbMysql::query_definitions[] = {
,

/* 0018_uar_del_temp */
"DROP TABLE temp "
"DROP TABLE IF EXISTS temp "
,

/* 0019_uar_del_temp1 */
"DROP TABLE temp1 "
"DROP TABLE IF EXISTS temp1 "
,

/* 0020_uar_last_full */
Expand Down
4 changes: 2 additions & 2 deletions core/src/cats/postgresql_queries.inc
Expand Up @@ -211,11 +211,11 @@ const char *BareosDbPostgresql::query_definitions[] = {
,

/* 0018_uar_del_temp */
"DROP TABLE temp "
"DROP TABLE IF EXISTS temp "
,

/* 0019_uar_del_temp1 */
"DROP TABLE temp1 "
"DROP TABLE IF EXISTS temp1 "
,

/* 0020_uar_last_full */
Expand Down
4 changes: 2 additions & 2 deletions core/src/cats/sqlite_queries.inc
Expand Up @@ -214,11 +214,11 @@ const char *BareosDbSqlite::query_definitions[] = {
,

/* 0018_uar_del_temp */
"DROP TABLE temp "
"DROP TABLE IF EXISTS temp "
,

/* 0019_uar_del_temp1 */
"DROP TABLE temp1 "
"DROP TABLE IF EXISTS temp1 "
,

/* 0020_uar_last_full */
Expand Down
8 changes: 4 additions & 4 deletions core/src/dird/query.sql
Expand Up @@ -90,8 +90,8 @@ SELECT DISTINCT Job.JobId,VolumeName
# 8
:List Volumes to Restore All Files
*Enter Client Name:
!DROP TABLE temp;
!DROP TABLE temp2;
!DROP TABLE IF EXISTS temp;
!DROP TABLE IF EXISTS temp2;
CREATE TABLE temp (JobId BIGINT NOT NULL,
JobTDate BIGINT,
ClientId BIGINT,
Expand Down Expand Up @@ -135,8 +135,8 @@ INSERT INTO temp2 SELECT DISTINCT Job.JobId,Job.StartTime,Media.VolumeName,
AND JobMedia.MediaId=Media.MediaId;
# list results
SELECT DISTINCT VolumeName from temp2;
!DROP TABLE temp;
!DROP TABLE temp2;
!DROP TABLE IF EXISTS temp;
!DROP TABLE IF EXISTS temp2;

# 9
:List Pool Attributes for a selected Pool
Expand Down

0 comments on commit 946bf7d

Please sign in to comment.