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

Add int data type

parent b66b1e14
No related branches found
No related tags found
1 merge request!8Feature add copy statement
Pipeline #39205 canceled
......@@ -13,7 +13,7 @@ namespace semanticalAnalysis {
if (stmt == nullptr) throw semantic_sql_error("unknown statement type");
if (db.hasTable(stmt->tableName)) throw semantic_sql_error("table '" + stmt->tableName + "' already exists");
std::vector<std::string> definedColumnNames;
std::vector<std::string> typeNames = {"bool","date","integer","longinteger","numeric","char","varchar","timestamp","text"};
std::vector<std::string> typeNames = {"bool","date","integer","int","longinteger","numeric","char","varchar","timestamp","text"};
for (auto &column : stmt->columns) {
if (column.nullable) throw semantic_sql_error("not supported nullable option for column '" + column.name + "'");
......@@ -42,6 +42,8 @@ namespace semanticalAnalysis {
sqlType = Sql::getDateTy(columnSpec.nullable);
} else if (columnSpec.type.compare("integer") == 0) {
sqlType = Sql::getIntegerTy(columnSpec.nullable);
} else if (columnSpec.type.compare("int") == 0) {
sqlType = Sql::getIntegerTy(columnSpec.nullable);
} else if (columnSpec.type.compare("longinteger") == 0) {
sqlType = Sql::getLongIntegerTy(columnSpec.nullable);
} else if (columnSpec.type.compare("numeric") == 0) {
......
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