SQL statement splitter breaks E'...' strings that contain a backslash-escaped quote
Maintainer thường phản hồi trong vòng 1 ngày
@7ttp đang làm issue này rồi.
Từ ngày 29/9/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Affected area: Migrations
Supabase CLI version: current develop (d38ccd7e)
Operating system: Any. Reproduced with a unit test on Linux.
Installation method: Built from source
Command
supabase db push
Actual output
A migration containing this statement fails with a syntax error:
select E'it\'s; here';
The CLI splits the statement at the semicolon inside the string literal and sends select E'it\'s and here' as two statements.
Expected behavior
The statement is sent as one statement. In an escape string constant, \' is an escaped quote and does not end the literal.
Steps to reproduce
- Add a migration that contains
select E'it\'s; here';. - Run
supabase db pushagainst a database. - See the syntax error caused by the split statement.
Additional context
The splitter in apps/cli/src/command-internal/sql-split.ts only treats a doubled quote as an escape inside single-quoted strings. PostgreSQL also accepts backslash escapes in E'...' strings, so the first \' is read as the end of the literal. A unit test for splitAndTrim fails on develop and passes when backslash escapes are honored for escape string constants only. Standard strings such as 'a\' are unchanged. The same splitter is used by seed files and the declarative schema commands.
I have a fix with a unit test ready and can open a PR if this is open for contribution.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.4k
- Fork
- 526
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 327
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của supabase/cli
-
Migration error caret is missing or misplaced when the statement contains multibyte charactersĐang mở🐛 Bug supabase/cli
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
supabase db reset intermittently fails: temporary Realtime init job races with the running Realtime service on "schema_migrations_pkey"Có thể đã có người làm @7ttp đã nhận hôm nay. Đang mở🐛 Bug supabase/cli
supabase/cli#6915 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
🐛 Bug supabase/cli
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
🐛 Bug supabase/cli
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
🐛 Bug supabase/cli
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
area/frontend good first issue kind/cooldown
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
voidzero-dev/oxc-angular-compiler#511 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
langchain-ai/deepagentsjs#898 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
anomalyco/models.dev#8509 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug documentation P2 UI/UX
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày