how does enable_dollar_quote interact with DELIMITER $$ in the mysql client?
06:09 14 May 2026
I’m checking the behavior of enable_dollar_quote in PolarDB MySQL

After enabling dollar-quoted strings, SQL like this works as a raw string literal:

```sql
  SELECT $$hello;
  'world'$$ AS s;

But many of our existing scripts use the mysql client pattern:

  DELIMITER $$
  CREATE PROCEDURE p()
  BEGIN
    SELECT 1;
  END$$
  DELIMITER ;

If enable_dollar_quote is on, how does PolarDB distinguish $$...$$ string literals from DELIMITER $$ statement terminators?

Could scripts that use DELIMITER $$ conflict with dollar-quoted strings, especially in procedures containing SQL like:

  SELECT $$hello;
  world$$ AS s;
polardb