Skip to content
Snippets Groups Projects
Commit 83636435 authored by Thomas Blum's avatar Thomas Blum
Browse files

Allow nullable values

parent 72e73a45
No related branches found
No related tags found
No related merge requests found
Pipeline #38547 canceled
......@@ -28,7 +28,7 @@ Value::~Value()
value_op_t Value::castString(const std::string & str, SqlType type)
{
assert(!type.nullable);
//assert(!type.nullable);
switch (type.typeID) {
case SqlType::TypeID::UnknownID:
......@@ -58,7 +58,7 @@ value_op_t Value::load(const void * ptr, SqlType type)
{
if (type.nullable) {
// return NullableValue::load(ptr, type);
throw NotImplementedException();
// throw NotImplementedException();
}
switch (type.typeID) {
......
......@@ -170,7 +170,7 @@ void genPrintValue(Value & sqlValue)
}
nullCheck.Else();
{
genPrintAvailableValue(sqlValue);
genPrintAvailableValue(nullableValue.getValue());
}
nullCheck.EndIf();
} else {
......
......@@ -15,8 +15,6 @@ namespace semanticalAnalysis {
std::vector<std::string> definedColumnNames;
std::vector<std::string> typeNames = {"bool","date","integer","longinteger","numeric","char","varchar","timestamp","text"};
for (auto &column : stmt->columns) {
if (column.nullable) throw semantic_sql_error("not supported nullable option at column '" + column.name + "'");
if (std::find(definedColumnNames.begin(),definedColumnNames.end(),column.name) != definedColumnNames.end())
throw semantic_sql_error("column '" + column.name + "' already exists");
definedColumnNames.push_back(column.name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment