Skip to content
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: addgeometrycolumn() panics when argument types don't match expectations #51829

Closed
knz opened this issue Jul 23, 2020 · 1 comment
Closed
Assignees
Labels
A-geometry-builtins Builtins which have geometry as args. A-geometry-creation-builtins Builtins which have geometry as a return statement. A-spatial Spatial work that is *not* related to builtins. A-sql-builtins SQL built-in functions and semantics thereof. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Comments

@knz
Copy link
Contributor

knz commented Jul 23, 2020

Found by the RSG:

https://teamcity.cockroachdb.com/buildConfiguration/Cockroach_Nightlies_RandomSyntaxTests/2107812?showLog=2107812_13653_5028.13653

addgeometrycolumn() panics upon NULLs and various other type/value mismatches.

Example failing queries (they don't all panic for the same reasons! - see log linked above for details):

> SELECT addgeometrycolumn(e'5[\fJ_YE':::STRING, e' I.DR\x12ev-':::STRING, 127:::INT8, e'\x0eqZ':::STRING, 6398145403934288141:::INT8, NULL::bool);

>             SELECT addgeometrycolumn(e'{9\x04mnmg':::STRING, NULL::string, e'z{\x17U\x18\x14UF':::STRING, 8520410167010259393:::INT8, 'GF ;':::STRING, 7764205041022882552:::INT8) ;

>             SELECT addgeometrycolumn(e'\x126\x16\x06s':::STRING, e'Fj{\x19\x19\x13D':::STRING, NULL, '0no=i&uQ':::STRING, (SELECT NULL)::int, e'\fS@0':::STRING, (-7500098369049293782):::INT8) ;

>             SELECT addgeometrycolumn('"':::STRING, e'\x06\x03\x01\x01\x19T6f\x07':::STRING, e'89`\x1b':::STRING, 1977200249595480410:::INT8, e'{?+\n$Q':::STRING, (-3034910843779736710):::INT8, NULL) ;

>             SELECT addgeometrycolumn(e'\x04@M\x16 eE':::STRING, e'?\b\x14':::STRING, NULL, NULL, (-7099251036844177579):::INT8, true) ;

>             SELECT addgeometrycolumn(e'+;2(\x1e\x17E@#':::STRING, e'^pJb\x1f,u':::STRING, NULL::string, e'\x160\x1e':::STRING, 161857094515090885:::INT8, e'\x1fU&J\nD\tl\x1b':::STRING, (-5730490449251080638):::INT8) ;

>             SELECT addgeometrycolumn('6I':::STRING, NULL::string, NULL, e'W%\r\frA':::STRING, (-5183107820916174161):::INT8, e'8\x0e':::STRING, (SELECT NULL)::int) ;

>             SELECT addgeometrycolumn(NULL::string, '_LCc':::STRING, e'\x16S\x13*':::STRING, e'K\x02/\x1aN':::STRING, 5506395100193079333:::INT8, '':::STRING, (-1137261238327904854):::INT8, true) 

>             SELECT addgeometrycolumn(NULL, e'%\x02<\x1f[\x06u\x05':::STRING, (-5209870055390698110):::INT8, NULL::string, 7965275392428739073:::INT8) ;

cc @otan for triage.

@knz knz added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. A-sql-builtins SQL built-in functions and semantics thereof. A-spatial Spatial work that is *not* related to builtins. A-geometry-builtins Builtins which have geometry as args. A-geometry-creation-builtins Builtins which have geometry as a return statement. labels Jul 23, 2020
@knz knz mentioned this issue Jul 23, 2020
25 tasks
@rytaft
Copy link
Collaborator

rytaft commented Jul 29, 2020

None of these queries panic anymore on master. These panics were fixed by #50992 and #51226.

@rytaft rytaft closed this as completed Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-geometry-builtins Builtins which have geometry as args. A-geometry-creation-builtins Builtins which have geometry as a return statement. A-spatial Spatial work that is *not* related to builtins. A-sql-builtins SQL built-in functions and semantics thereof. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Projects
None yet
Development

No branches or pull requests

2 participants