Skip to content

Instantly share code, notes, and snippets.

@jordanburke
Last active June 22, 2025 16:18
Show Gist options
  • Select an option

  • Save jordanburke/5f5838b64faa7a79b8760b758a4d12b1 to your computer and use it in GitHub Desktop.

Select an option

Save jordanburke/5f5838b64faa7a79b8760b758a4d12b1 to your computer and use it in GitHub Desktop.

Revisions

  1. jordanburke renamed this gist Jun 22, 2025. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. jordanburke created this gist Jun 22, 2025.
    35 changes: 35 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    // Minimal reproduction of Kuzu ALTER TABLE getAll() hang bug
    // Bug: getAll() intermittently hangs on subsequent ALTER TABLE results in batch queries
    // Tested with: Kuzu 0.10.0, Node.js v22.14.0

    const kuzu = require('kuzu');

    async function reproduceBug() {
    const db = new kuzu.Database('./test-db');
    const conn = new kuzu.Connection(db);

    // Create table
    await conn.query('CREATE NODE TABLE Test(id INT64, PRIMARY KEY(id));');

    // Execute multiple ALTER TABLE statements
    const results = await conn.query(`
    ALTER TABLE Test ADD col1 STRING;
    ALTER TABLE Test ADD col2 STRING;
    `);

    console.log('Got', results.length, 'results');

    // Process first result - this works
    console.log('Processing result 1...');
    const rows1 = await results[0].getAll();
    console.log('Result 1:', rows1); // Output: [{ result: 'Table Test altered.' }]
    results[0].close();

    // Process second result - this hangs intermittently (~30-50% of the time)
    console.log('Processing result 2...');
    const rows2 = await results[1].getAll(); // <-- HANGS HERE INTERMITTENTLY
    console.log('Result 2:', rows2); // Sometimes never reached
    results[1].close();
    }

    reproduceBug().catch(console.error);