Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
andyfengHKU committed Apr 10, 2024
1 parent 5a010b4 commit 1ae4860
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 103 deletions.
2 changes: 1 addition & 1 deletion src/binder/bind/bind_ddl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ std::unique_ptr<BoundStatement> Binder::bindRenameTable(const Statement& stateme
static void validatePropertyExist(TableCatalogEntry* tableEntry, const std::string& propertyName) {
if (!tableEntry->containProperty(propertyName)) {
throw BinderException(
tableEntry->getName() + " table doesn't have property " + propertyName + ".");
tableEntry->getName() + " table does not have property " + propertyName + ".");
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/transaction/transaction_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void TransactionContext::validateManualTransaction(bool allowActiveTransaction,
bool readOnlyStatement) {
KU_ASSERT(hasActiveTransaction());
if (activeTransaction->isReadOnly() && !readOnlyStatement) {
throw ConnectionException("Can't execute a write query inside a read-only transaction.");
throw ConnectionException("Can not execute a write query inside a read-only transaction.");
}
if (!allowActiveTransaction) {
throw ConnectionException(
Expand Down
6 changes: 3 additions & 3 deletions test/test_files/exceptions/binder/binder_error.test
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Binder exception: The number of columns to union/union all must be the same.
-LOG UnionAllUnmatchedDataTypesOfExpressions
-STATEMENT MATCH (p:person) RETURN p.fName UNION ALL MATCH (p1:person) RETURN p1.age
---- error
Binder exception: p1.age has data type INT64 but (STRING) was expected.
Binder exception: p1.age has data type INT64 but STRING was expected.

-LOG UnionAndUnionAllInSingleQuery
-STATEMENT MATCH (p:person) RETURN p.age UNION ALL MATCH (p1:person) RETURN p1.age UNION MATCH (p1:person) RETURN p1.age
Expand Down Expand Up @@ -444,7 +444,7 @@ Catalog exception: Table: person1 does not exist.
-LOG DropNonExistedColumn
-STATEMENT alter table person drop random
---- error
Binder exception: person table doesn't have property random.
Binder exception: person table does not have property random.

-LOG DropPrimaryKeyColumn
-STATEMENT alter table person drop ID
Expand Down Expand Up @@ -535,7 +535,7 @@ Binder exception: Invalid option name: thread.
-LOG InvalidCallOptionValue
-STATEMENT CALL threads='abc'
---- error
Binder exception: abc has data type STRING but (INT64) was expected.
Binder exception: abc has data type STRING but INT64 was expected.

-LOG AllShortestPathInvalidLowerBound
-STATEMENT MATCH p = (a)-[* ALL SHORTEST 2..3]-(b) RETURN p
Expand Down
6 changes: 3 additions & 3 deletions test/test_files/tck/match/match1.test
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ Binder exception: Cannot bind r as node pattern.
---- ok
-STATEMENT MATCH ()-[r]-(r) RETURN r;
---- error
Binder exception: r has data type NODE but (REL) was expected.
Binder exception: r has data type NODE but REL was expected.
-STATEMENT MATCH ()-[r]->(r) RETURN r;
---- error
Binder exception: r has data type NODE but (REL) was expected.
Binder exception: r has data type NODE but REL was expected.
-STATEMENT MATCH ()<-[r]-(r) RETURN r;
---- error
Binder exception: r has data type NODE but (REL) was expected.
Binder exception: r has data type NODE but REL was expected.
-STATEMENT MATCH ()-[r]-()-[]-(r) RETURN r;
---- error
Binder exception: Cannot bind r as node pattern.
Expand Down
144 changes: 72 additions & 72 deletions test/test_files/tck/match/match2.test

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/test_files/tck/match/match4.test
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Binder exception: Bind relationship r to relationship with same name is not supp
MATCH (first)-[rs*]->(second)
RETURN first, second;
---- error
Binder exception: rs has data type LIST but (RECURSIVE_REL) was expected.
Binder exception: rs has data type REL[] but RECURSIVE_REL was expected.

# Fail when asterisk operator is missing
# Fail on negative bound
Expand Down
35 changes: 16 additions & 19 deletions test/test_files/tinysnb/call/call.test
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ False
---- ok
-STATEMENT CALL var_length_extend_max_depth=10
---- error
Can't execute a write query inside a read-only transaction.

-CASE CallFunctionTable
Can not execute a write query inside a read-only transaction.

-LOG NodeTableInfo
-STATEMENT CALL table_info('person') RETURN *
Expand Down Expand Up @@ -162,6 +160,20 @@ height
2:2|STRUCT(locations STRING[], transfer STRUCT(day DATE, amount INT64[]))
2:2|UNION(firstmet DATE, type INT16, comment STRING)

-LOG StorageInfo
-STATEMENT MATCH (p:person) RETURN COUNT(p)
---- 1
8
-STATEMENT CALL storage_info('person') RETURN COUNT(*)
---- 1
38
-STATEMENT CALL storage_info('knows') RETURN COUNT(*)
---- 1
80
-STATEMENT CALL storage_info('workAt') RETURN COUNT(*)
---- 1
22

-CASE CallNodeTableWith300ColumnsInfo
-DEFINE COLS REPEAT 2400 "col${count} INT64,"

Expand Down Expand Up @@ -210,19 +222,4 @@ Binder exception: Show connection can only bind to String!
Binder exception: Show connection can only be called on a rel table!
-STATEMENT MATCH (a:person) CALL show_connection(a.fName) RETURN *
---- error
Binder exception: Cannot evaluate a.fName as a literal.

-CASE StorageInfo
-PARALLELISM 1
-STATEMENT MATCH (p:person) RETURN COUNT(p)
---- 1
8
-STATEMENT CALL storage_info('person') RETURN COUNT(*)
---- 1
38
-STATEMENT CALL storage_info('knows') RETURN COUNT(*)
---- 1
80
-STATEMENT CALL storage_info('workAt') RETURN COUNT(*)
---- 1
22
Binder exception: a.fName has type PROPERTY but LITERAL was expected.
4 changes: 2 additions & 2 deletions test/test_files/tinysnb/function/start_end_node.test
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
-LOG StartNodeTestRecursiveRel
-STATEMENT MATCH (:person { fName: "Alice" })-[r:knows *1..2]->(friend:person) RETURN START_NODE(r)
---- error
Binder exception: r has data type RECURSIVE_REL but (REL) was expected.
Binder exception: r has data type RECURSIVE_REL but REL was expected.


-CASE FunctionEndNode
Expand Down Expand Up @@ -112,4 +112,4 @@ Binder exception: r has data type RECURSIVE_REL but (REL) was expected.
-LOG EndNodeTestRecursiveRel
-STATEMENT MATCH (:person { fName: "Alice" })-[r:knows *1..2]->(friend:person) RETURN END_NODE(r)
---- error
Binder exception: r has data type RECURSIVE_REL but (REL) was expected.
Binder exception: r has data type RECURSIVE_REL but REL was expected.
2 changes: 1 addition & 1 deletion test/test_files/transaction/create_macro/create_macro.test
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ result|6|5.600000|00:20:00|[1,3,2]
---- ok
-STATEMENT CREATE MACRO var_macro(x) AS x
---- error
Can't execute a write query inside a read-only transaction.
Can not execute a write query inside a read-only transaction.

0 comments on commit 1ae4860

Please sign in to comment.