Skip to content

Commit

Permalink
Fix ci and udt
Browse files Browse the repository at this point in the history
  • Loading branch information
acquamarin committed Jul 25, 2024
1 parent 2311215 commit dd840d8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/binder/bind/bind_ddl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ std::unique_ptr<BoundStatement> Binder::bindCreateTable(const Statement& stateme
std::unique_ptr<BoundStatement> Binder::bindCreateType(const Statement& statement) {
auto createType = statement.constPtrCast<CreateType>();
auto name = createType->getName();
auto type = LogicalType::fromString(createType->getDataType());
LogicalType type;
if (!LogicalType::tryConvertFromString(createType->getDataType(), type)) {
type =
clientContext->getCatalog()->getType(clientContext->getTx(), createType->getDataType());
}
if (clientContext->getCatalog()->containsType(clientContext->getTx(), name)) {
throw BinderException{common::stringFormat("Duplicated type name: {}.", name)};
}
Expand Down
2 changes: 0 additions & 2 deletions src/include/binder/ddl/bound_create_table_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ struct KUZU_API BoundExtraCreateTableInfo : public BoundExtraCreateCatalogEntryI
: BoundExtraCreateTableInfo{copyVector(other.propertyInfos)} {}
BoundExtraCreateTableInfo& operator=(const BoundExtraCreateTableInfo&) = delete;

BoundExtraCreateTableInfo& operator=(const BoundExtraCreateTableInfo&) = delete;

std::unique_ptr<BoundExtraCreateCatalogEntryInfo> copy() const override {
return std::make_unique<BoundExtraCreateTableInfo>(*this);
}
Expand Down
18 changes: 18 additions & 0 deletions test/test_files/user_defined_types/user_defined_types.test
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,21 @@ Binder exception: Duplicated type name: DESCRIPTION.
30|40|False|
5|20|False|
8|100|False|

-CASE Example
-STATEMENT CREATE TYPE BIGINT AS INT64;
---- ok
-STATEMENT CREATE NODE TABLE PERSON (ID BIGINT, PRIMARY KEY(ID));
---- ok
-STATEMENT CREATE (p:PERSON {ID: 5});
---- ok
-STATEMENT CREATE (p:PERSON {ID: 10});
---- ok
-STATEMENT MATCH (p:PERSON) RETURN CAST(p.ID AS INT32);
---- 2
5
10
-STATEMENT CREATE TYPE LENGTH AS BIGINT;
---- ok
-STATEMENT CREATE NODE TABLE STUDENT (ID BIGINT, HEIGHT LENGTH, PRIMARY KEY(ID));
---- ok

0 comments on commit dd840d8

Please sign in to comment.