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
CREATETABLE `host_summary` (
`id` binary(16) NOT NULL DEFAULT (uuid_to_bin(uuid())),
`private_region`char(8) NOT NULL,
`vdc`char(8) NOT NULL,
`host_type`char(32) NOT NULL,
`host_count`intNOT NULL DEFAULT '0',
`updated_at`timestampNOT NULL DEFAULT CURRENT_TIMESTAMPONUPDATECURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;
CREATETABLE `host` (
`id` binary(16) NOT NULL DEFAULT (uuid_to_bin(uuid())),
`vdc`char(64) NOT NULL,
`private_region`varchar(64) NOT NULL,
`host_type`char(12) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;
SQL queries
-- name: UpdateHostSummary :execresultUPDATE host_summary
JOIN (
SELECTCOUNT(*) AS count,
vdc,
host_type
FROM host
WHERE vdc =sqlc.arg('vdc')
AND host_type =sqlc.arg('host_type')
GROUP BY vdc,
host_type
) AS counts ONhost_summary.vdc=counts.vdcANDhost_summary.host_type=counts.host_typeSEThost_summary.host_count=counts.count;
Version
1.26.0
What happened?
MySQL UPDATE with JOIN panics with panic: expected range var
Relevant log output
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/1086795c00eb4f72df5ef8550b1ca588e2db496b3b90c098c38ccb9ee492b467
What operating system are you using?
macOS
What database engines are you using?
MySQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: