added test for table sequence
This commit is contained in:
@@ -15,6 +15,7 @@ void prepare_column(sql::query_context& ctx, const sql::dialect& d, const table_
|
||||
attribute_string_writer writer(d, {});
|
||||
expression_evaluator v(d, ctx);
|
||||
col.expression()->accept(v);
|
||||
ctx.sql += v.result();
|
||||
|
||||
if (col.has_alias()) {
|
||||
ctx.sql.append(" ").append(d.as()).append(" ").append(col.alias());
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
|
||||
#include "matador/query/expression/column_expression.hpp"
|
||||
|
||||
namespace matador::query {
|
||||
|
||||
table_column operator ""_col(const char *name, const size_t len) {
|
||||
@@ -67,6 +69,10 @@ table_column::table_column(const class table* tab,
|
||||
table_column::table_column(const std::shared_ptr<abstract_column_expression>& expression) noexcept
|
||||
: table_column(nullptr, "", "", utils::basic_type::Unknown, {}, sql::sql_function_t::None, expression) {}
|
||||
|
||||
table_column::table_column(column_expression&& expression) noexcept
|
||||
: table_column(std::shared_ptr(expression.release())) {
|
||||
}
|
||||
|
||||
table_column & table_column::operator=(const table_column &other) {
|
||||
if (this == &other) {
|
||||
return *this;
|
||||
@@ -95,7 +101,7 @@ bool table_column::equals(const table_column &x) const {
|
||||
}
|
||||
|
||||
table_column table_column::as(const std::string& alias) const {
|
||||
return {table_, column_name_, alias, type_, attributes_, function_};
|
||||
return {table_, column_name_, alias, type_, attributes_, function_, expression_};
|
||||
}
|
||||
|
||||
const std::string& table_column::name() const {
|
||||
|
||||
Reference in New Issue
Block a user