Conversation
Replace strdup() calls with sqlite3_mprintf() to ensure consistent memory management. Error messages allocated with strdup() (standard malloc) were being freed with sqlite3_free(), causing crashes. Fixes #2
…ation (#4) * Initial plan * Fix vendor script and workflows to handle missing dependencies gracefully Co-authored-by: gabewillen <91307534+gabewillen@users.noreply.github.com> * Add release creation script and documentation Co-authored-by: gabewillen <91307534+gabewillen@users.noreply.github.com> * Update CONTRIBUTING.md with release process reference Co-authored-by: gabewillen <91307534+gabewillen@users.noreply.github.com> * Add comprehensive fixes summary documentation Co-authored-by: gabewillen <91307534+gabewillen@users.noreply.github.com> * Improve Makefile generation in vendor script with better error handling Co-authored-by: gabewillen <91307534+gabewillen@users.noreply.github.com> * Add comprehensive testing and verification plan Co-authored-by: gabewillen <91307534+gabewillen@users.noreply.github.com> * Add GitHub Actions workflow for manual release creation via UI Co-authored-by: gabewillen <91307534+gabewillen@users.noreply.github.com> * Add UI workflow quick reference guide Co-authored-by: gabewillen <91307534+gabewillen@users.noreply.github.com> * Address code review feedback: add error handling and fix documentation Co-authored-by: gabewillen <91307534+gabewillen@users.noreply.github.com> * Remove Ubuntu 20.04 from CI workflows and documentation Co-authored-by: gabewillen <91307534+gabewillen@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: gabewillen <91307534+gabewillen@users.noreply.github.com>
* Update checkout action to use 'main' branch * Remove skip_validation option from release workflow Removed skip_validation input from create-release workflow.
* Initial plan * Restructure and optimize README based on SQLite extension best practices Co-authored-by: gabewillen <91307534+gabewillen@users.noreply.github.com> * Update README.md --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: gabewillen <91307534+gabewillen@users.noreply.github.com> Co-authored-by: Jeffrey Jewett <jeffrey.jewett@gmail.com>
Implemented all 3 remaining error validation tests in Create2: - Test 19: Reject undirected relationships in CREATE - Test 20: Reject bidirectional relationships in CREATE - Test 23: Reject relationship variable rebinding Added comprehensive relationship pattern validation to semantic analyzer. Results: - Create2: 24/24 passing (100%) - Overall TCK: 44 tests passing (17% coverage) - No regressions introduced 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixed two post-rebase issues: 1. Updated tck_test_clauses_create.c library path from "build/libgraph" to "../build/libgraph" to match other TCK tests 2. Removed references to deleted test files from Makefile (test_insert_nodes, test_cypher_basic, etc.) Verified no regressions: - All 24 Create2 tests still passing (100%) - Overall CREATE test suite: 78 tests, 22 failures, 2 ignored (as expected) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
These directories should remain local for development purposes. Added tck/ to .gitignore (.agents/ was already present).
There was a problem hiding this comment.
Pull Request Overview
This PR implements comprehensive TCK (Technology Compatibility Kit) test coverage for the Create2 test suite and makes several foundational improvements to the codebase. The changes achieve 100% test coverage for Create2 (24/24 tests passing) while also refactoring test infrastructure and fixing database schema inconsistencies.
Key Changes:
- Complete Create2 TCK test suite implementation with relationship pattern validation
- Database schema standardization (node_id→id, edge_id→id, from_node→source, to_node→target)
- Enhanced MERGE clause parsing with ON CREATE/ON MATCH support
- Test infrastructure refactoring with shared test utilities and placeholder suites
- Python test cleanup (removal of development scripts)
Reviewed Changes
Copilot reviewed 67 out of 81 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_*.c | New test infrastructure with common utilities and placeholder suites |
| tests/Makefile | Refactored build system with output directory organization |
| tests/tck_test_clauses_*.c | Updated TCK tests with proper library paths and implementations |
| src/cypher/cypher-storage.c | Fixed column name consistency (node_id→id, from_node→source, etc.) |
| src/cypher/cypher-parser.c | Enhanced MERGE parsing with ON clauses and multi-label support |
| src/cypher/cypher-lexer.c | Added ON token for MERGE clause support |
| src/cypher/cypher-logical-plan.c | Improved memory management for MERGE details |
| src/cypher/cypher-executor.c | Enhanced error message propagation |
| tests/python_support/* | New Python test harness infrastructure |
| tests/*.py (deleted) | Removed development/debug Python scripts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if conn is not None: | ||
| try: | ||
| conn.close() | ||
| except Exception: |
There was a problem hiding this comment.
'except' clause does nothing but pass and there is no explanatory comment.
|
|
||
| *pResult = apArgs[0]; | ||
| return SQLITE_OK; | ||
| } |
There was a problem hiding this comment.
Bug: Shallow Copies: Memory Corruption Risk
The cypherFunctionMin and cypherFunctionMax functions perform shallow copies of argument values by direct assignment (*pResult = apArgs[0]), which creates aliased pointers when copying CYPHER_VALUE_STRING, CYPHER_VALUE_LIST, or CYPHER_VALUE_MAP types. When cypherEvaluateFunction later calls cypherValueDestroy(&aValues[i]) to clean up arguments, these shared pointers get freed, leaving pResult pointing to deallocated memory. This causes use-after-free bugs when the result value is accessed or destroyed.
- Fix library path in tck_test_clauses_create.c from '../build/libgraph' to 'build/libgraph' to match execution context from project root - Add placeholder test_clauses_match.c to satisfy build requirements - Add logs/ directory to .gitignore to exclude test execution logs Verification: All 24 Create2 TCK tests passing (100% success rate) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
ee70f03 to
3d29394
Compare
There was a problem hiding this comment.
Bug: Inconsistent Resource Handling Leaks
Memory leak in cypherValueSetString when the value was previously a list or map. The function only frees the existing string if pValue->type is already CYPHER_VALUE_STRING, but if the value was previously a CYPHER_VALUE_LIST or CYPHER_VALUE_MAP, those resources won't be freed. Other setter functions like cypherValueSetInteger, cypherValueSetFloat, and cypherValueSetBoolean correctly call cypherValueDestroy(pValue) first to free any existing resources before assigning the new value.
src/cypher/cypher-execution-context.c#L260-L278
sqlite-graph/src/cypher/cypher-execution-context.c
Lines 260 to 278 in 3d29394
| echo "Error: Not on main branch (current: $CURRENT_BRANCH)" | ||
| echo "To release from a different branch, enable 'Skip branch validation'" | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
Bug: Workflow Input Undefined, Validation Misleading
The workflow references inputs.skip_validation in the branch validation step, but this input is not defined in the workflow_dispatch inputs section. This causes the branch validation to always run (since the undefined input evaluates to false), making the error message on line 74 misleading. Either the skip_validation input needs to be added to the workflow inputs, or the conditional and error message should be removed.
- Added anonymous relationship syntax support (-->, --, <--) - Implemented 8/30 Match3 scenarios (27% complete) - Multi-hop pattern matching now working (two-hop, three-hop) - Label filtering in patterns implemented - Updated all TCK documentation and status files Test Results: - Match1: 4/6 passing (67%) - Match2: 2/8 passing (25%) - Match3: 8/30 passing (27%) - NEW! - Total: 14/161 MATCH tests passing (9%) Files Modified: - src/cypher/cypher-parser.c - Anonymous relationship syntax - tests/test_clauses_match.c - 8 new Match3 test implementations - .agents/plans/* - Updated TCK documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Description
WIP: Complete Create2 TCK Test Suite Implementation
This PR implements all remaining tests for the Create2 TCK test suite (Creating Relationships), achieving 100% test coverage (24/24 tests passing). This is a work-in-progress that includes the complete
implementation plus cleanup of development artifacts.
Related Issues
Closes #
Type of Change
Changes Made
Testing
make test)Test Evidence
Create2 Test Suite Results:
Overall CREATE Test Suite:
No regressions introduced - all previously passing tests still pass.
Documentation
Checklist
Breaking Changes
N/A
Performance Impact
Screenshots / Examples
Error Validation Examples: