You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PREPARE, EXECUTE and DEALLOCATE PREPARE are parse errors #2863
Prepared statements in SQL are parse errors: PREPARE name FROM 'text', EXECUTE name [USING @var, ...] and DEALLOCATE PREPARE name.
Seen in the MySQL server tests run (alasql-mysqltest): 13,462 statements in 204 files (ps.test, ps_1general.test, and many tests that run each query again as a prepared statement). Reproduced with alasql 4.21.0:
alasql('CREATE TABLE t1 (a INT)');alasql('INSERT INTO t1 VALUES (1), (2)');alasql("PREPARE stmt FROM 'SELECT a FROM t1 WHERE a = ?'");// Parse erroralasql('SET @x = 2');alasql('EXECUTE stmt USING @x');// Parse erroralasql('DEALLOCATE PREPARE stmt');// Parse error
Expected: EXECUTE stmt USING @x gives [{a: 2}]. AlaSQL already compiles statements with ? parameters (alasql.compile), so these statements can use that.
Breaking?
No. Today these are parse errors.
This holds as long as the new words PREPARE and DEALLOCATE stay usable as names, so that SELECT prepare FROM t on a column called prepare keeps working. #2627 is the list of keywords made usable as names this way.
Activity
mateuscmtropical commentedon Nov 11, 2026
Hi, I'd like to work on this one.
mateuscmtropical commentedon Nov 11, 2026
Hi, I've opened a PR for this: #3038