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

int8recv and substring(bytea) for correctness checking #13069

Closed
lmatz opened this issue Oct 26, 2023 · 0 comments · Fixed by #13077
Closed

int8recv and substring(bytea) for correctness checking #13069

lmatz opened this issue Oct 26, 2023 · 0 comments · Fixed by #13077
Assignees
Milestone

Comments

@lmatz
Copy link
Contributor

lmatz commented Oct 26, 2023

In PG, we use the following:

SELECT BIT_XOR(('x'||SUBSTR(MD5(%s), 17, 16))::bit(64)::bigint) FROM %s

to compare the results of two queries.

However, since RW hasn't supported the bit data type, we are unable to convert the hexadecimal varchar into a bigint.

@xiangjinwu gives the solution that:

  1. we need a int8recv(bytea) -> bigint, which is already supported as an internal function i64::from_be_bytes. Expose it to user.
  2. we need a substring(bytea).

Once we have these two supported, we write the following instead:

int8recv(SUBSTR(decode(MD5(%s), 'hex'), 9, 8))
int8recv(SUBSTR(sha256(%s), 9, 8))

cc: @cyliu0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants