{"action":"closed","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/20464","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/20464/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/20464/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/20464/events","html_url":"https://github.com/cockroachdb/cockroach/issues/20464","id":279241628,"number":20464,"title":"distsqlrun: panic when calling date_trunc in a distSQL plan","user":{"login":"lego","id":1161183,"avatar_url":"https://avatars0.githubusercontent.com/u/1161183?v=4","gravatar_id":"","url":"https://api.github.com/users/lego","html_url":"https://github.com/lego","followers_url":"https://api.github.com/users/lego/followers","following_url":"https://api.github.com/users/lego/following{/other_user}","gists_url":"https://api.github.com/users/lego/gists{/gist_id}","starred_url":"https://api.github.com/users/lego/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lego/subscriptions","organizations_url":"https://api.github.com/users/lego/orgs","repos_url":"https://api.github.com/users/lego/repos","events_url":"https://api.github.com/users/lego/events{/privacy}","received_events_url":"https://api.github.com/users/lego/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-12-05T04:25:20Z","updated_at":"2017-12-06T19:46:12Z","closed_at":"2017-12-06T19:46:12Z","author_association":"MEMBER","body":"The following schema and statements will cause a panic.\r\n```sql\r\nCREATE TABLE topics (created_at TIMESTAMP NULL);\r\n\r\nINSERT INTO topics VALUES ('2017-12-05 04:04:04.913231+00:00');\r\n\r\nSELECT date_trunc('month', created_at) AS date_trunc_month_created_at FROM \"topics\";\r\n```\r\n\r\nWhen running in the local execution engine, everything is fine.\r\n\r\n```sql\r\npanic: invalid datum type given: timestamptz, expected timestamp\r\n\r\ngoroutine 23358 [running]:\r\ngithub.com/cockroachdb/cockroach/pkg/sql/sqlbase.DatumToEncDatum(0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x69ef300, 0xc4271d65a0, ...)\r\n\t/Users/joey/.go/src/github.com/cockroachdb/cockroach/pkg/sql/sqlbase/encoded_datum.go:122 +0x26e\r\ngithub.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*ProcOutputHelper).ProcessRow(0xc4257f4a00, 0x69defc0, 0xc4239de300, 0xc4244b1c00, 0x12, 0x12, 0x80, 0x14fd4a35d3c48708, 0x0, 0x0, ...)\r\n\t/Users/joey/.go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/processors.go:330 +0x7ae\r\ngithub.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*ProcOutputHelper).EmitRow(0xc4257f4a00, 0x69defc0, 0xc4239de300, 0xc4244b1c00, 0x12, 0x12, 0xc42290ab00, 0xc42290ab70, 0x0)\r\n\t/Users/joey/.go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/processors.go:264 +0x8e\r\ngithub.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*tableReader).Run(0xc4257f4a00, 0x69defc0, 0xc4239de300, 0xc42290aa88)\r\n\t/Users/joey/.go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/tablereader.go:171 +0x3f9\r\ncreated by github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*Flow).Start\r\n\t/Users/joey/.go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/flow.go:419 +0x3d7\r\n```\r\n\r\n(yours truly, the gift that keeps giving: 💎-🛤 testing)"}}
{"actor":{"display_login":"lego"}}