From 0c3b7773c62fb26bebd54d739dd8ecfadbb39e1c Mon Sep 17 00:00:00 2001 From: Mingzhuo Yin Date: Wed, 18 Sep 2024 20:13:18 +0800 Subject: [PATCH] fix: set length of RecordMat::token with NAMEDATALEN (#17) 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 --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 958ccad..11024c0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -34,7 +34,7 @@ pub fn tokenize(t: &str) -> Vec { #[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,