Skip to content

Commit

Permalink
fix: set length of RecordMat::token with NAMEDATALEN (#17)
Browse files Browse the repository at this point in the history
The length of `NAME` type can be customized in
`include/pg_config_manual.h` from postgre. It's better to use macro from
postgres instead of hard coding.

Signed-off-by: Mingzhuo Yin <[email protected]>
  • Loading branch information
silver-ymz authored Sep 18, 2024
1 parent 3126173 commit 0c3b777
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn tokenize(t: &str) -> Vec<String> {
#[derive(Debug)]
#[repr(C)]
struct RecordMat {
token: [u8; 64],
token: [u8; pgrx::pg_sys::NAMEDATALEN as usize],
id: i32,
how_many_tokens: i32,
idf: f32,
Expand Down

0 comments on commit 0c3b777

Please sign in to comment.