The console cut a script at every ; outside literals and comments, so a routine or trigger body ran in pieces: Execute on the DELETE inside a CREATE TRIGGER ... BEGIN ... END ran only that DELETE, a SQLite trigger script stopped with "incomplete input", a DELIMITER // script (mysqldump output) with 42000, a PostgreSQL BEGIN ATOMIC procedure with 42601, an SSMS script with "Incorrect syntax near 'GO'", and a SQL Server CREATE PROCEDURE kept only its first statement.
Statements now end where each dialect's own client ends them: a SQLite CREATE TRIGGER at ; END ;, PostgreSQL routines by counting BEGIN/CASE/END outside parentheses (psql), MySQL by DELIMITER lines and BEGIN ... END bodies of stored programs, with statements made only of executable comments (/*! ... */) kept, and SQL Server by GO lines, with CREATE/ALTER PROCEDURE/FUNCTION/TRIGGER taking the rest of its batch and IF ... BEGIN ... END / TRY-CATCH blocks staying whole.
Co-authored-by: ntbang0901 <[email protected]>