-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: default_int_size does not apply to integer literals #72138
Comments
should we just default int size to 4 anyway? |
Apparently that was the plan at one point in history:
|
spicy |
this is more because of the family stuff (resolution logic relies on families rather than oids). casting anything atm assumes the same family and will default to the "family main type":
|
I think that problem is specific to how we've implemented In other words, if you do a datadriven pgwire test like
(note the cast), then it does correctly show a DataTypeOID of 21. But the DataTypeOID is not affected by just the For some context, I filed this issue because the jasync-sql test suite does queries like |
Ah I see what you're probably getting at. The type is determined in the optimizer here: cockroach/pkg/sql/opt/optbuilder/scope.go Lines 266 to 272 in a159b0b
Since I wonder if we could enhance this part of the type-checking to be aware of default_int_size... cockroach/pkg/sql/opt/optbuilder/scope.go Lines 436 to 443 in a159b0b
An even lower-level would be to make |
I don't think that seems all that invasive. |
This affects efcore.pf tests |
Describe the problem
With the following:
one would expect that the integer sent back over the wire would be an INT4. However, if you use Wireshark (or any client that cares about integer types) you'll see that it's actually an INT8.
To Reproduce
The following pgwire test:
run with
make test PKG=./pkg/sql/pgwire TESTS='TestPGTest'
Expected behavior
The test should pass, but instead it returns a
DataTypeOID
of 20 (int8)Additional context
Jira issue: CRDB-10964
The text was updated successfully, but these errors were encountered: