BEGIN line.BEGIN the statement worked.[ERROR] Error: D1_ERROR that's happening on production but not locally?INSERT INTO calendar (c_id, for_date, status) VALUES (?1, ?2, ?3) ON CONFLICT DO UPDATE SET status = excluded.status;'INSERT INTO calendar (c_id, for_date, status) VALUES ('122393', '2023-04-03', 'AVAILABLE') ON CONFLICT DO UPDATE SET status = excluded.status;
➜ npx wrangler@d1 d1 execute test-db --file 0000_initial.sql
🌀 Mapping SQL input into an array of statements
🌀 Parsing 25 statements
🌀 Executing on test-db (c020574a-5623-407b-be0c-cd192bab9545):CREATE TRIGGER 'updated_records_to_changelog' AFTER UPDATE OF 'status' ON 'availabilities'
WHEN OLD.status <> NEW.status
BEGIN
INSERT INTO changelog (c_id, for_date, status_was, status_is)
VALUES (OLD.c_id, OLD.for_date, OLD.status, NEW.status);
END; (error) Error: Error: Error 9000: exception caught in D1 core. unreachable RuntimeError: unreachable
at wasm://wasm/00f5753e:wasm-function[4783]:0x31be54
at wasm://wasm/00f5753e:wasm-function[4836]:0x322be4
at wasm://wasm/00f5753e:wasm-function[4877]:0x32c7d6
at wasm://wasm/00f5753e:wasm-function[237]:0x29575
at wasm://wasm/00f5753e:wasm-function[4973]:0x34351d
at Object.s2 [as query] (index.js:2418:157)
at async Sqlite.query (index.js:3205:23)
at async sqliteQuery (index.js:9409:29)
at async index.js:9167:22INSERT INTO calendar (c_id, for_date, status)
VALUES
(122393 '2023-04-03', 'AVAILABLE'),
(122393 '2023-04-04', 'AVAILABLE'),
(122393, '2023-04-05', 'AVAILABLE'),
...
ON CONFLICT DO UPDATE SET status = excluded.status;