Skip to content
Snippets Groups Projects
Commit 84a65823 authored by Victor Kotlyar's avatar Victor Kotlyar
Browse files

Add catalogue schema verification for global and temporary tables.

parent 9266e9b6
Branches
Tags
No related merge requests found
Pipeline #32488 failed
......@@ -62,7 +62,7 @@ std::map<std::string, std::string> CatalogueSchema::getSchemaColumns(const std::
searchPos = findResult + 1;
if(0 < sqlStmt.size()) { // Ignore empty statements
const std::string createTableSQL = "CREATE TABLE " + tableName + "[ ]*\\(([a-zA-Z0-9_, '\\)\\(]+)\\)";
const std::string createTableSQL = "CREATE[a-zA-Z ]+TABLE " + tableName + "[ ]*\\(([a-zA-Z0-9_, '\\)\\(]+)\\)";
cta::utils::Regex tableSqlRegex(createTableSQL.c_str());
auto tableSql = tableSqlRegex.exec(sqlStmt);
if (2 == tableSql.size()) {
......@@ -107,7 +107,7 @@ std::list<std::string> CatalogueSchema::getSchemaTableNames() const {
searchPos = findResult + 1;
if(0 < sqlStmt.size()) { // Ignore empty statements
cta::utils::Regex tableNamesRegex("CREATE TABLE ([a-zA-Z_0-9]+)");
cta::utils::Regex tableNamesRegex("CREATE[a-zA-Z ]+TABLE ([a-zA-Z_0-9]+)");
auto tableName = tableNamesRegex.exec(sqlStmt);
if (2 == tableName.size()) {
schemaTables.push_back(tableName[1].c_str());
......
......@@ -69,8 +69,7 @@ echo "Preparing CTA configuration for tests"
kubectl --namespace ${NAMESPACE} exec ctafrontend -- cta-catalogue-schema-verify /etc/cta/cta-catalogue.conf
if [ $? -ne 0 ]; then
echo "ERROR: failed to verify the catalogue DB schema"
# Making this non-fatal until cta-catalogue-schema-verify is fixed (see issue #540)
#exit 1
exit 1
fi
kubectl --namespace ${NAMESPACE} exec ctafrontend -- cta-catalogue-admin-user-create /etc/cta/cta-catalogue.conf --username ctaadmin1 -m "docker cli"
for ((i=0; i<${#TAPEDRIVES_IN_USE[@]}; i++)); do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment