-
Notifications
You must be signed in to change notification settings - Fork 180
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
fix(operators)!: swap operator types #1024
Conversation
Coverage Report
File Coverage |
@goce-cz or any other person (e.g. @ST-DDT, @dolezel or @littlewhywhat) should have a look if this is a correct fix |
ac7cfd1
to
584c1d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have integration tests that actually run these commands against a postgres?
`CREATE OPERATOR CLASS "gist__int_ops" DEFAULT FOR TYPE "_int4" USING "gist" AS | ||
OPERATOR 3 "&&", | ||
OPERATOR 6 "="(anyarray, anyarray), | ||
OPERATOR 7 "@>", | ||
OPERATOR 8 "<@", | ||
OPERATOR 20 "@@"(_int4, query_int), | ||
FUNCTION 1 "g_int_consistent"(internal, _int4, smallint, oid, internal), | ||
FUNCTION 2 "g_int_union"(internal, internal), | ||
FUNCTION 3 "g_int_compress"(internal), | ||
FUNCTION 4 "g_int_decompress"(internal), | ||
FUNCTION 5 "g_int_penalty"(internal, internal, internal), | ||
FUNCTION 6 "g_int_picksplit"(internal, internal), | ||
FUNCTION 7 "g_int_same"(_int4, _int4, internal);` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I throw that against a postgres, I get:
ERROR: syntax error at or near ","
LINE 2: OPERATOR 3 "&&",
It get's slightly better, when you remove the quotes:
As shown by the example from postgres:
CREATE OPERATOR CLASS gist__int_ops
DEFAULT FOR TYPE _int4 USING gist AS
OPERATOR 3 &&,
OPERATOR 6 = (anyarray, anyarray),
OPERATOR 7 @>,
OPERATOR 8 <@,
OPERATOR 20 @@ (_int4, query_int),
FUNCTION 1 g_int_consistent (internal, _int4, smallint, oid, internal),
FUNCTION 2 g_int_union (internal, internal),
FUNCTION 3 g_int_compress (internal),
FUNCTION 4 g_int_decompress (internal),
FUNCTION 5 g_int_penalty (internal, internal, internal),
FUNCTION 6 g_int_picksplit (internal, internal),
FUNCTION 7 g_int_same (_int4, _int4, internal);
Sadly even with that I get an error:
ERROR: operator does not exist: integer[] && integer[]
But that might be caused by my test setup being cobbled together.
(or me not having a clue, what this does/it is used for)
I looked into the integration tests and nope, there are no integration tests that calls Integration tests are on my mental list and will be improved after I have covered a good minimum with unit tests, because the unit tests are also running on my local setup and not only in CI/CD. I do not have problems with the quotes yet, because the migration builder is called with options where you can configure the behavior. When I covered with unit tests and did some other tasks, I will come back to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is only a step towards actually working, then it looks good to me.
For the protocol and future reads: I currently do coverage unit tests to stabilize the "API" (functions and their signatures) I will merge this MR when I'm done with the basic coverage, so that it is not in the middle of several |
584c1d4
to
cc15515
Compare
example: https://www.postgresql.org/docs/current/sql-createopclass.html