Skip to content

Commit

Permalink
dbcopy: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
franku committed Jan 31, 2020
1 parent 76aaba2 commit b3ff488
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion core/src/cats/ddl/creates/mysql.sql
Expand Up @@ -56,7 +56,7 @@ CREATE TABLE RestoreObject (
RestoreObjectId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
ObjectName BLOB NOT NULL,
RestoreObject LONGBLOB NOT NULL,
PluginName TINYBLOB NOT NULL,
PluginName BLOB NOT NULL,
ObjectLength INTEGER DEFAULT 0,
ObjectFullLength INTEGER DEFAULT 0,
ObjectIndex INTEGER DEFAULT 0,
Expand Down
9 changes: 1 addition & 8 deletions core/src/dird/dbcopy/database_export_postgresql.cc
Expand Up @@ -100,15 +100,11 @@ void DatabaseExportPostgresql::CopyRow(RowData& origin_data)

query_into += query_values;

#if 0
std::cout << query_into << std::endl;
#else
if (!db_->SqlQuery(query_into.c_str())) {
std::string err{"DatabaseExportPostgresql: Could not execute query: "};
err += db_->get_errmsg();
throw std::runtime_error(err);
}
#endif
}

void DatabaseExportPostgresql::CopyStart() { SelectSequenceSchema(); }
Expand All @@ -130,10 +126,7 @@ static void UpdateSequences(
throw std::runtime_error(
"DatabaseExportPostgresql: Could not set sequence");
}
#if 0
std::cout << "Updating sequence for table: " << s.table_name <<
std::endl;
#endif
std::cout << "Updating sequence for table: " << s.table_name << std::endl;
}
}

Expand Down
9 changes: 5 additions & 4 deletions systemtests/CMakeLists.txt
Expand Up @@ -124,11 +124,12 @@ endmacro()
macro(handle_python_plugin_modules test_name)
set(PYMODULES_TO_LINK_TO_SRC)

string(REGEX MATCH ^dbcopy.* starts_with_dbcopy ${test_name})
string(REGEX MATCH ^python-fd.* starts_with_python-fd ${test_name})
if(starts_with_python-fd)
list(APPEND FD_PYMODULES_TO_LINK_TO_SRC BareosFdWrapper.py
BareosFdPluginBaseclass.py bareos_fd_consts.py
bareos-fd-mock-test.py
if(starts_with_python-fd OR starts_with_dbcopy)
list(APPEND PYMODULES_TO_LINK_TO_SRC filed/BareosFdWrapper.py
filed/BareosFdPluginBaseclass.py filed/bareos_fd_consts.py
filed/bareos-fd-mock-test.py
)
endif()

Expand Down
Expand Up @@ -7,5 +7,7 @@ FileSet {
}
#File = "@sbindir@"
File=<@tmpdir@/file-list
#Plugin = "python:module_path=@python_plugin_module_src_test_dir@:module_name=bareos-fd-local-fileset-with-restoreobjects:filename=@tmpdir@/file-list:deny=.*link.*"
Plugin = "python:module_path=@python_plugin_module_src_test_dir@:module_name=bareos-fd-local-fileset-with-restoreobjects:filename=@tmpdir@/file-list-python-plugin"
}
}
Expand Up @@ -6,8 +6,8 @@ Client {
# if "Plugin Names" is defined, only the specified plugins will be loaded,
# otherwise all filedaemon plugins (*-fd.so) from the "Plugin Directory".
#
# Plugin Directory = "@python_plugin_module_src_fd@"
# Plugin Names = ""
Plugin Directory = "@fd_plugin_binary_path@"
Plugin Names = "python"

# if compatible is set to yes, we are compatible with bacula
# if set to no, new bareos features are enabled which is the default
Expand Down
2 changes: 2 additions & 0 deletions systemtests/tests/dbcopy-mysql-postgresql-test/testrunner
Expand Up @@ -27,6 +27,8 @@ BackupDirectory="${tmp}/data"
# Data will be placed at "${tmp}/data/".
setup_data

echo "$conf" > "$tmp/file-list-python-plugin"

start_test

#enable only mysql (disable postgresql)
Expand Down

0 comments on commit b3ff488

Please sign in to comment.