fixed compilation

This commit is contained in:
Sascha Kühl
2025-12-16 16:21:09 +01:00
parent 4a19322ef8
commit 9eec5b64fb
10 changed files with 98 additions and 88 deletions
+10 -3
View File
@@ -26,11 +26,13 @@ column::column(const char *name, const std::string& as)
{}
column::column(std::string name, std::string as)
: name_(std::move(name))
: table_(default_table())
, name_(std::move(name))
, alias_(std::move(as)) {}
column::column(const sql::sql_function_t func, std::string name)
: name_(std::move(name))
: table_(default_table())
, name_(std::move(name))
, function_(func) {}
column::column(const class table* tab, std::string name, std::string as)
@@ -95,4 +97,9 @@ column::operator const std::string&() const {
return name_;
}
}
query::table* column::default_table() {
static query::table default_table;
return &default_table;
}
}
+4 -4
View File
@@ -1,7 +1,7 @@
#include "matador/query/generator.hpp"
namespace matador::query::generator {
column_generator::column_generator( const std::string& table_name, const column_generator_options options)
column_generator::column_generator(const std::string& table_name, const column_generator_options options)
: options_(options) {
table_stack_.push(table_name.empty() ? std::make_shared<table>() : std::make_shared<table>(table_name));
}
@@ -12,7 +12,7 @@ column_generator::column_generator(const object::repository& repo, const std::st
table_stack_.push(table_name.empty() ? std::make_shared<table>() : std::make_shared<table>(table_name));
}
void column_generator::on_revision( const char* id, uint64_t& ) {
void column_generator::on_revision(const char* id, uint64_t&) {
push(id);
}
@@ -20,9 +20,9 @@ void column_generator::push( const std::string& column_name ) {
if (is_column_generator_option_set(options_, column_generator_options::GenerateAlias)) {
char str[4];
snprintf(str, 4, "c%02d", ++column_index);
result_.emplace_back(table_stack_.top(), column_name, str);
result_.emplace_back(table_stack_.top().get(), column_name, str);
} else {
result_.emplace_back(table_stack_.top(), column_name);
result_.emplace_back(table_stack_.top().get(), column_name);
}
}
+1 -1
View File
@@ -449,7 +449,7 @@ std::string query_compiler::build_add_constraint_string(const class constraint &
}
std::string query_compiler::build_drop_constraint_string(const class constraint &c) {
return dialect_->drop_constraint() + " " + build_constraint_name(c);
}
std::string query_compiler::build_constraint_name(const class constraint &c) {