cloudflare / cloudflare/workers-sdk
π BUG: when trying to left join 2 tables that have same name columns - second column is not returned
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.5k
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 187
Description
### Which Cloudflare product(s) does this pertain to?
D1
### What version of `Wrangler` are you using?
2.19.0
### What operating system are you using?
macOS
### Describe the Bug
As per issue [#555](https://github.com/drizzle-team/drizzle-orm/issues/555) we can see, that d1 stopped returning duplicate names from different tables. It was working before and it's how any other driver is doing for `raw` mode
```bash
$ pnpm wrangler d1 execute dzltest --command='select "users"."id", "posts"."id", "posts"."ownerId", "posts"."title", "posts"."content" from "users" left join "posts" on "posts"."ownerId" = "users"."id";'
ββββββ¬ββββββββββ¬ββββββββ¬ββββββββββββ
β id β ownerId β title β content β
ββββββΌββββββββββΌββββββββΌββββββββββββ€
β 2 β 1 β test β 111111111 β
ββββββΌββββββββββΌββββββββΌββββββββββββ€
β 3 β 1 β ueoau β ueueu β
ββββββΌββββββββββΌββββββββΌββββββββββββ€
β 1 β 1 β xxx β yyy β
ββββββ΄ββββββββββ΄ββββββββ΄ββββββββββββ
```
But should return `id` for user and `id` for posts as well
Expected
```bash
ββββββ¬βββββ¬ββββββββββ¬ββββββββ¬ββββββββββββ
β id β id β ownerId β title β content β
ββββββΌβββββΌββββββββββΌββββββββΌββββββββββββ€
β 2 β 1 β 1 β test β 111111111 β
ββββββΌβββββΌββββββββββΌββββββββΌββββββββββββ€
β 3 β 2 β 1 β ueoau β ueueu β
ββββββΌβββββΌββββββββββΌββββββββΌββββββββββββ€
β 1 β 3 β 1 β xxx β yyy β
ββββββ΄βββββ΄ββββββββββ΄ββββββββ΄ββββββββββββ
```
Contributor guide
Assessment
This issue has not been assessed yet.