forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: propagate opt types through renders
Previously, folded expressions would sometimes get improperly typed, because the optimizer type would be lost and replaced with the ResolvedType of the folded expression. Datums can sometimes have imprecise ResolvedTypes if they were created from expressions with non-canonical types of a family. Fixes cockroachdb#48563. Release note (bug fix): improve accuracy of column types returned from queries to improve PostgreSQL compatibility.
- Loading branch information
1 parent
f66ff29
commit b16dcae
Showing
8 changed files
with
78 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
send | ||
Query {"String": "CREATE TABLE a (a INT PRIMARY KEY)"} | ||
---- | ||
|
||
until | ||
ReadyForQuery | ||
---- | ||
{"Type":"CommandComplete","CommandTag":"CREATE TABLE"} | ||
{"Type":"ReadyForQuery","TxStatus":"I"} | ||
|
||
send | ||
Query {"String": "INSERT INTO a VALUES(1)"} | ||
---- | ||
|
||
until | ||
ReadyForQuery | ||
---- | ||
{"Type":"CommandComplete","CommandTag":"INSERT 0 1"} | ||
{"Type":"ReadyForQuery","TxStatus":"I"} | ||
|
||
# Make sure that values casted to "char" get their type oid and type size | ||
# reported correctly via pgwire. | ||
|
||
send | ||
Query {"String": "SELECT 'a'::\"char\" FROM a"} | ||
---- | ||
|
||
until | ||
ReadyForQuery | ||
---- | ||
{"Type":"RowDescription","Fields":[{"Name":"char","TableOID":0,"TableAttributeNumber":0,"DataTypeOID":18,"DataTypeSize":1,"TypeModifier":-1,"Format":0}]} | ||
{"Type":"DataRow","Values":[{"text":"a"}]} | ||
{"Type":"CommandComplete","CommandTag":"SELECT 1"} | ||
{"Type":"ReadyForQuery","TxStatus":"I"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters