| 1 | /* |
| 2 | Copyright (C) 2009-2015 Brazil |
| 3 | Copyright (C) 2018-2026 Sutou Kouhei <[email protected]> |
| 4 | |
| 5 | This library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Lesser General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2.1 of the License, or (at your option) any later version. |
| 9 | |
| 10 | This library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | Lesser General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Lesser General Public |
| 16 | License along with this library; if not, write to the Free Software |
| 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | #include "grn_index_column.h"cxx . . $ `<file>/lib/grn_index_column.h`/ |
| 21 | |
| 22 | #include "grn_hash.h"cxx . . $ `<file>/lib/grn_hash.h`/ |
| 23 | #include "grn_ii.h"cxx . . $ `<file>/lib/grn_ii.h`/ |
| 24 | #include "grn_progress_logger.h"cxx . . $ `<file>/lib/grn_progress_logger.h`/ |
| 25 | |
| 26 | #include <math.h> |
| 27 | #include <string.h> |
| 28 | |
| 29 | static uint64_tcxx . . $ uint64_t# grn_index_sparsitycxx . . $ grn_index_sparsity. = 10; |
| 30 | |
| 31 | void |
| 32 | grn_index_column_init_from_envcxx . . $ grn_index_column_init_from_env(49f6e7a06ebc5aa8).(void) |
| 33 | { |
| 34 | { |
| 35 | char grn_index_sparsity_env[GRN_ENV_BUFFER_SIZEcxx . . $ `include/groonga/portability.h:42:9`!]; |
| 36 | grn_getenvcxx . . $ `include/groonga/portability.h:58:11`!("GRN_INDEX_SPARSITY", |
| 37 | grn_index_sparsity_env, |
| 38 | GRN_ENV_BUFFER_SIZEcxx . . $ `include/groonga/portability.h:42:9`!); |
| 39 | if (grn_index_sparsity_env[0]) { |
| 40 | uint64_tcxx . . $ uint64_t# sparsity; |
| 41 | errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! = 0; |
| 42 | sparsity = strtoullcxx . . $ strtoull(fa707f2e7d9ad629).(grn_index_sparsity_env, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, 0); |
| 43 | if (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! == 0) { |
| 44 | grn_index_sparsitycxx . . $ grn_index_sparsity. = sparsity; |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | static inline void |
| 51 | grn_index_column_build_call_hookcxx . . $ grn_index_column_build_call_hook(e479a3a8a47195ce).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 52 | grn_objcxx . . $ grn_obj# *obj, |
| 53 | grn_idcxx . . $ grn_id# id, |
| 54 | grn_objcxx . . $ grn_obj# *old_value, |
| 55 | grn_objcxx . . $ grn_obj# *value, |
| 56 | int flags) |
| 57 | { |
| 58 | grn_hookcxx . . $ grn_hook# *hooks = DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(obj)->hookscxx . . $ $anonymous_type_4a7c1014017e4c5d_0#hooks.[GRN_HOOK_SETcxx . . $ GRN_HOOK_SET.]; |
| 59 | |
| 60 | if (hooks) { |
| 61 | /* todo : grn_proc_ctx_open() */ |
| 62 | grn_objcxx . . $ grn_obj# id_, flags_; |
| 63 | grn_proc_ctxcxx . . $ grn_proc_ctx# pctx; |
| 64 | grn_proc_ctx_initcxx . . $ grn_proc_ctx_init(165c580d47b8a996).(&pctx, hooks, 4, 4); |
| 65 | GRN_UINT32_INITcxx . . $ `include/groonga/groonga.h:2854:9`!(&id_, 0); |
| 66 | GRN_UINT32_INITcxx . . $ `include/groonga/groonga.h:2854:9`!(&flags_, 0); |
| 67 | GRN_UINT32_SETcxx . . $ `include/groonga/groonga.h:2909:9`!(ctx, &id_, id); |
| 68 | GRN_UINT32_SETcxx . . $ `include/groonga/groonga.h:2909:9`!(ctx, &flags_, flags); |
| 69 | while (hooks) { |
| 70 | grn_ctx_pushcxx . . $ grn_ctx_push(4865d068a46d0f83).(ctx, &id_); |
| 71 | grn_ctx_pushcxx . . $ grn_ctx_push(4865d068a46d0f83).(ctx, old_value); |
| 72 | grn_ctx_pushcxx . . $ grn_ctx_push(4865d068a46d0f83).(ctx, value); |
| 73 | grn_ctx_pushcxx . . $ grn_ctx_push(4865d068a46d0f83).(ctx, &flags_); |
| 74 | pctx.callercxx . . $ _grn_proc_ctx#caller. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 75 | pctx.currhcxx . . $ _grn_proc_ctx#currh. = hooks; |
| 76 | if (hooks->proccxx . . $ _grn_hook#proc.) { |
| 77 | hooks->proccxx . . $ _grn_hook#proc.->funcscxx . . $ _grn_proc#funcs.[PROC_INITcxx . . $ PROC_INIT.](ctx, 1, &obj, &pctx.user_datacxx . . $ _grn_proc_ctx#user_data.); |
| 78 | } else { |
| 79 | grn_obj_default_set_value_hookcxx . . $ grn_obj_default_set_value_hook(fd082858389c8bb0).(ctx, 1, &obj, &pctx.user_datacxx . . $ _grn_proc_ctx#user_data.); |
| 80 | } |
| 81 | if (ctx->rccxx . . $ _grn_ctx#rc.) { |
| 82 | return; |
| 83 | } |
| 84 | hooks = hooks->nextcxx . . $ _grn_hook#next.; |
| 85 | pctx.offsetcxx . . $ _grn_proc_ctx#offset.++; |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | static void |
| 91 | grn_index_column_build_columncxx . . $ grn_index_column_build_column(4ad76b35c8eff5b1).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 92 | grn_objcxx . . $ grn_obj# *index_column, |
| 93 | grn_objcxx . . $ grn_obj# *table, |
| 94 | grn_objcxx . . $ grn_obj# *column) |
| 95 | { |
| 96 | grn_objcxx . . $ grn_obj# old_value; |
| 97 | grn_objcxx . . $ grn_obj# value; |
| 98 | int cursor_flags = GRN_CURSOR_BY_IDcxx . . $ `include/groonga/table.h:280:9`!; |
| 99 | |
| 100 | GRN_VOID_INITcxx . . $ `include/groonga/groonga.h:2749:9`!(&old_value); |
| 101 | grn_obj_reinit_forcxx . . $ grn_obj_reinit_for(d825b4ed5bf12304).(ctx, &old_value, column); |
| 102 | GRN_VOID_INITcxx . . $ `include/groonga/groonga.h:2749:9`!(&value); |
| 103 | grn_obj_reinit_forcxx . . $ grn_obj_reinit_for(d825b4ed5bf12304).(ctx, &value, column); |
| 104 | if (GRN_OBJ_TABLEPcxx . . $ `lib/grn_db.h:376:9`!(column)) { |
| 105 | GRN_TABLE_EACH_BEGIN_FLAGScxx . . $ `include/groonga/table.h:631:9`!(ctx, table, cursor, id, cursor_flags) |
| 106 | { |
| 107 | GRN_BULK_REWINDcxx . . $ `include/groonga/groonga.h:2599:9`!(&value); |
| 108 | grn_table_get_key2cxx . . $ grn_table_get_key2(bd0cb75328e85567).(ctx, column, id, &value); |
| 109 | grn_index_column_build_call_hookcxx . . $ grn_index_column_build_call_hook(e479a3a8a47195ce).(ctx, column, id, &old_value, &value, 0); |
| 110 | } |
| 111 | GRN_TABLE_EACH_ENDcxx . . $ `include/groonga/table.h:665:9`!(ctx, cursor); |
| 112 | } else { |
| 113 | grn_column_cachecxx . . $ grn_column_cache# *cache; |
| 114 | cache = grn_column_cache_opencxx . . $ grn_column_cache_open(1f11c2abc91decee).(ctx, column); |
| 115 | if (cache) { |
| 116 | GRN_TABLE_EACH_BEGIN_FLAGScxx . . $ `include/groonga/table.h:631:9`!(ctx, table, cursor, id, cursor_flags) |
| 117 | { |
| 118 | void *raw_value; |
| 119 | size_t value_size; |
| 120 | GRN_BULK_REWINDcxx . . $ `include/groonga/groonga.h:2599:9`!(&value); |
| 121 | raw_value = grn_column_cache_refcxx . . $ grn_column_cache_ref(970d42cfa65b7df1).(ctx, cache, id, &value_size); |
| 122 | grn_bulk_writecxx . . $ grn_bulk_write(4609c18fd87cf054).(ctx, &value, raw_value, value_size); |
| 123 | grn_index_column_build_call_hookcxx . . $ grn_index_column_build_call_hook(e479a3a8a47195ce).(ctx, |
| 124 | column, |
| 125 | id, |
| 126 | &old_value, |
| 127 | &value, |
| 128 | 0); |
| 129 | } |
| 130 | GRN_TABLE_EACH_ENDcxx . . $ `include/groonga/table.h:665:9`!(ctx, cursor); |
| 131 | grn_column_cache_closecxx . . $ grn_column_cache_close(82dbd8387ea46c62).(ctx, cache); |
| 132 | } else { |
| 133 | GRN_TABLE_EACH_BEGIN_FLAGScxx . . $ `include/groonga/table.h:631:9`!(ctx, table, cursor, id, cursor_flags) |
| 134 | { |
| 135 | GRN_BULK_REWINDcxx . . $ `include/groonga/groonga.h:2599:9`!(&value); |
| 136 | grn_obj_get_valuecxx . . $ grn_obj_get_value(6e06fec66698a6a).(ctx, column, id, &value); |
| 137 | grn_index_column_build_call_hookcxx . . $ grn_index_column_build_call_hook(e479a3a8a47195ce).(ctx, |
| 138 | column, |
| 139 | id, |
| 140 | &old_value, |
| 141 | &value, |
| 142 | 0); |
| 143 | } |
| 144 | GRN_TABLE_EACH_ENDcxx . . $ `include/groonga/table.h:665:9`!(ctx, cursor); |
| 145 | } |
| 146 | } |
| 147 | GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &old_value); |
| 148 | GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &value); |
| 149 | } |
| 150 | |
| 151 | grn_rccxx . . $ grn_rc# |
| 152 | grn_index_column_buildcxx . . $ grn_index_column_build(4865d068a46d0f83).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *index_column) |
| 153 | { |
| 154 | grn_objcxx . . $ grn_obj# *src, *target; |
| 155 | grn_idcxx . . $ grn_id# *s = DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(index_column)->sourcecxx . . $ $anonymous_type_4a7c1014017e4c5d_0#source.; |
| 156 | |
| 157 | if (!(DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(index_column)->source_sizecxx . . $ $anonymous_type_4a7c1014017e4c5d_0#source_size.) || !s) { |
| 158 | return ctx->rccxx . . $ _grn_ctx#rc.; |
| 159 | } |
| 160 | |
| 161 | src = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, *s); |
| 162 | if (!src) { |
| 163 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "invalid source"); |
| 164 | return ctx->rccxx . . $ _grn_ctx#rc.; |
| 165 | } |
| 166 | |
| 167 | target = GRN_OBJ_TABLEPcxx . . $ `lib/grn_db.h:376:9`!(src) ? src : grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, src->headercxx . . $ _grn_obj#header..domaincxx . . $ _grn_obj_header#domain.); |
| 168 | if (!target) { |
| 169 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "invalid target"); |
| 170 | return ctx->rccxx . . $ _grn_ctx#rc.; |
| 171 | } |
| 172 | |
| 173 | grn_table_flagscxx . . $ grn_table_flags# lexicon_flags; |
| 174 | grn_iicxx . . $ grn_ii# *ii = (grn_iicxx . . $ grn_ii# *)index_column; |
| 175 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! use_grn_ii_build; |
| 176 | grn_objcxx . . $ grn_obj# *tokenizer = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 177 | grn_table_get_infocxx . . $ grn_table_get_info(a1e4a6d36d3aee7c).(ctx, |
| 178 | ii->lexiconcxx . . $ _grn_ii#lexicon., |
| 179 | &lexicon_flags, |
| 180 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, |
| 181 | &tokenizer, |
| 182 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, |
| 183 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 184 | switch (lexicon_flags & GRN_OBJ_TABLE_TYPE_MASKcxx . . $ `include/groonga/groonga.h:687:9`!) { |
| 185 | case GRN_OBJ_TABLE_HASH_KEYcxx . . $ `include/groonga/groonga.h:688:9`!: |
| 186 | case GRN_OBJ_TABLE_PAT_KEYcxx . . $ `include/groonga/groonga.h:689:9`!: |
| 187 | case GRN_OBJ_TABLE_DAT_KEYcxx . . $ `include/groonga/groonga.h:690:9`!: |
| 188 | use_grn_ii_build = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!; |
| 189 | break; |
| 190 | default: |
| 191 | use_grn_ii_build = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!; |
| 192 | break; |
| 193 | } |
| 194 | const grn_column_flagscxx . . $ grn_column_flags# flags = grn_ii_get_flagscxx . . $ grn_ii_get_flags(2156535cb565d339).(ctx, ii); |
| 195 | if ((flags & GRN_OBJ_WITH_POSITIONcxx . . $ `include/groonga/groonga.h:794:9`!) && |
| 196 | (!tokenizer && !GRN_TYPE_IS_TEXT_FAMILYcxx . . $ `include/groonga/type.h:28:9`!(ii->lexicon->header.domain))) { |
| 197 | /* TODO: Support offline index construction for WITH_POSITION |
| 198 | * index against UInt32 vector column. */ |
| 199 | use_grn_ii_build = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!; |
| 200 | } |
| 201 | |
| 202 | size_t n_columns = DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(index_column)->source_sizecxx . . $ $anonymous_type_4a7c1014017e4c5d_0#source_size. / sizeof(grn_idcxx . . $ grn_id#); |
| 203 | grn_objcxx . . $ grn_obj# **columns = GRN_MALLOCcxx . . $ `lib/grn_alloc.h:41:9`!(n_columns * sizeof(grn_obj *)); |
| 204 | if (!columns) { |
| 205 | return ctx->rccxx . . $ _grn_ctx#rc.; |
| 206 | } |
| 207 | |
| 208 | grn_objcxx . . $ grn_obj# **cp; |
| 209 | size_t i; |
| 210 | for (cp = columns, i = n_columns; i > 0; s++, cp++, i--) { |
| 211 | if (!(*cp = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, *s))) { |
| 212 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "source invalid, i=%" GRN_FMT_SIZEcxx . . $ `lib/grn.h:408:11`!, i); |
| 213 | GRN_FREEcxx . . $ `lib/grn_alloc.h:49:9`!(columns); |
| 214 | return ctx->rccxx . . $ _grn_ctx#rc.; |
| 215 | } |
| 216 | } |
| 217 | grn_obj_set_visibilitycxx . . $ grn_obj_set_visibility(7f588588f63dc99e).(ctx, index_column, falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!); |
| 218 | if (use_grn_ii_build) { |
| 219 | grn_ii_buildcxx . . $ grn_ii_build(439ab1227c2cf654).(ctx, ii, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 220 | } else { |
| 221 | for (i = 0; i < n_columns; i++) { |
| 222 | grn_objcxx . . $ grn_obj# *column = columns[i]; |
| 223 | grn_index_column_build_columncxx . . $ grn_index_column_build_column(4ad76b35c8eff5b1).(ctx, index_column, target, column); |
| 224 | } |
| 225 | } |
| 226 | grn_obj_set_visibilitycxx . . $ grn_obj_set_visibility(7f588588f63dc99e).(ctx, index_column, truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!); |
| 227 | for (i = 0; i < n_columns; i++) { |
| 228 | grn_obj_unrefcxx . . $ grn_obj_unref(cda3a5f3c2e53c6b).(ctx, columns[i]); |
| 229 | } |
| 230 | GRN_FREEcxx . . $ `lib/grn_alloc.h:49:9`!(columns); |
| 231 | grn_obj_touchcxx . . $ grn_obj_touch(7ce09bc2deb0d26b).(ctx, index_column, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 232 | |
| 233 | if (target != src) { |
| 234 | grn_obj_unrefcxx . . $ grn_obj_unref(cda3a5f3c2e53c6b).(ctx, target); |
| 235 | } |
| 236 | grn_obj_unrefcxx . . $ grn_obj_unref(cda3a5f3c2e53c6b).(ctx, src); |
| 237 | |
| 238 | return ctx->rccxx . . $ _grn_ctx#rc.; |
| 239 | } |
| 240 | |
| 241 | grn_rccxx . . $ grn_rc# |
| 242 | grn_index_column_rebuildcxx . . $ grn_index_column_rebuild(4865d068a46d0f83).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *index_column) |
| 243 | { |
| 244 | grn_iicxx . . $ grn_ii# *ii = (grn_iicxx . . $ grn_ii# *)index_column; |
| 245 | |
| 246 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 247 | |
| 248 | grn_ii_truncatecxx . . $ grn_ii_truncate(57810f222e723019).(ctx, ii); |
| 249 | grn_index_column_buildcxx . . $ grn_index_column_build(4865d068a46d0f83).(ctx, index_column); |
| 250 | |
| 251 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 252 | } |
| 253 | |
| 254 | static const grn_log_levelcxx . . $ grn_log_level# grn_index_column_diff_progress_log_level_defaultcxx . . $ grn_index_column_diff_progress_log_level_default. = |
| 255 | GRN_LOG_DEBUGcxx . . $ GRN_LOG_DEBUG.; |
| 256 | |
| 257 | grn_rccxx . . $ grn_rc# |
| 258 | grn_index_column_diff_options_initcxx . . $ grn_index_column_diff_options_init(1fa4575cf38d9e7f).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 259 | grn_index_column_diff_optionscxx . . $ grn_index_column_diff_options# *options) |
| 260 | { |
| 261 | options->progress_log_levelcxx . . $ grn_index_column_diff_options#progress_log_level. = |
| 262 | grn_index_column_diff_progress_log_level_defaultcxx . . $ grn_index_column_diff_progress_log_level_default.; |
| 263 | return GRN_SUCCESScxx . . $ GRN_SUCCESS.; |
| 264 | } |
| 265 | |
| 266 | grn_rccxx . . $ grn_rc# |
| 267 | grn_index_column_diff_options_fincxx . . $ grn_index_column_diff_options_fin(1fa4575cf38d9e7f).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 268 | grn_index_column_diff_optionscxx . . $ grn_index_column_diff_options# *options) |
| 269 | { |
| 270 | return GRN_SUCCESScxx . . $ GRN_SUCCESS.; |
| 271 | } |
| 272 | |
| 273 | grn_index_column_diff_optionscxx . . $ grn_index_column_diff_options# * |
| 274 | grn_index_column_diff_options_opencxx . . $ grn_index_column_diff_options_open(4b6f4969eb541297).(grn_ctxcxx . . $ grn_ctx# *ctx) |
| 275 | { |
| 276 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 277 | grn_index_column_diff_optionscxx . . $ grn_index_column_diff_options# *options = |
| 278 | GRN_MALLOCcxx . . $ `lib/grn_alloc.h:41:9`!(sizeof(grn_index_column_diff_options)); |
| 279 | if (!options) { |
| 280 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 281 | } |
| 282 | grn_rccxx . . $ grn_rc# rc = grn_index_column_diff_options_initcxx . . $ grn_index_column_diff_options_init(1fa4575cf38d9e7f).(ctx, options); |
| 283 | if (rc != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 284 | GRN_FREEcxx . . $ `lib/grn_alloc.h:49:9`!(options); |
| 285 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 286 | } |
| 287 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(options); |
| 288 | } |
| 289 | |
| 290 | grn_rccxx . . $ grn_rc# |
| 291 | grn_index_column_diff_options_closecxx . . $ grn_index_column_diff_options_close(1fa4575cf38d9e7f).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 292 | grn_index_column_diff_optionscxx . . $ grn_index_column_diff_options# *options) |
| 293 | { |
| 294 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 295 | grn_rccxx . . $ grn_rc# rc = GRN_SUCCESScxx . . $ GRN_SUCCESS.; |
| 296 | if (options) { |
| 297 | rc = grn_index_column_diff_options_fincxx . . $ grn_index_column_diff_options_fin(1fa4575cf38d9e7f).(ctx, options); |
| 298 | GRN_FREEcxx . . $ `lib/grn_alloc.h:49:9`!(options); |
| 299 | } |
| 300 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(rc); |
| 301 | } |
| 302 | |
| 303 | grn_log_levelcxx . . $ grn_log_level# |
| 304 | grn_index_column_diff_options_get_progress_log_levelcxx . . $ grn_index_column_diff_options_get_progress_log_level(4272edcfb765fb9).( |
| 305 | grn_ctxcxx . . $ grn_ctx# *ctx, grn_index_column_diff_optionscxx . . $ grn_index_column_diff_options# *options) |
| 306 | { |
| 307 | if (options) { |
| 308 | return options->progress_log_levelcxx . . $ grn_index_column_diff_options#progress_log_level.; |
| 309 | } else { |
| 310 | return grn_index_column_diff_progress_log_level_defaultcxx . . $ grn_index_column_diff_progress_log_level_default.; |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | grn_rccxx . . $ grn_rc# |
| 315 | grn_index_column_diff_options_set_progress_log_levelcxx . . $ grn_index_column_diff_options_set_progress_log_level(f3ade1471de4f334).( |
| 316 | grn_ctxcxx . . $ grn_ctx# *ctx, grn_index_column_diff_optionscxx . . $ grn_index_column_diff_options# *options, grn_log_levelcxx . . $ grn_log_level# level) |
| 317 | { |
| 318 | options->progress_log_levelcxx . . $ grn_index_column_diff_options#progress_log_level. = level; |
| 319 | return GRN_SUCCESScxx . . $ GRN_SUCCESS.; |
| 320 | } |
| 321 | |
| 322 | typedef enumcxx . . $ $anonymous_type_512bede1a7d79c66_0# { |
| 323 | GRN_INDEX_COLUMN_DIFF_TYPE_REMAINScxx . . $ GRN_INDEX_COLUMN_DIFF_TYPE_REMAINS., |
| 324 | GRN_INDEX_COLUMN_DIFF_TYPE_MISSINGScxx . . $ GRN_INDEX_COLUMN_DIFF_TYPE_MISSINGS., |
| 325 | GRN_INDEX_COLUMN_DIFF_TYPE_LOOK_AHEADcxx . . $ GRN_INDEX_COLUMN_DIFF_TYPE_LOOK_AHEAD., |
| 326 | } grn_index_column_diff_typecxx . . $ grn_index_column_diff_type#; |
| 327 | /* Except LOOK_AHEAD */ |
| 328 | #define N_GRN_INDEX_COLUMN_DIFF_PERSISTENT_TYPEScxx . . $ `lib/index_column.c:328:9`! 2 |
| 329 | |
| 330 | static const char * |
| 331 | grn_index_column_diff_type_to_stringcxx . . $ grn_index_column_diff_type_to_string(cf79d79cd5614c55).(grn_index_column_diff_typecxx . . $ grn_index_column_diff_type# type) |
| 332 | { |
| 333 | switch (type) { |
| 334 | case GRN_INDEX_COLUMN_DIFF_TYPE_REMAINScxx . . $ GRN_INDEX_COLUMN_DIFF_TYPE_REMAINS.: |
| 335 | return "remains"; |
| 336 | case GRN_INDEX_COLUMN_DIFF_TYPE_MISSINGScxx . . $ GRN_INDEX_COLUMN_DIFF_TYPE_MISSINGS.: |
| 337 | return "missings"; |
| 338 | case GRN_INDEX_COLUMN_DIFF_TYPE_LOOK_AHEADcxx . . $ GRN_INDEX_COLUMN_DIFF_TYPE_LOOK_AHEAD.: |
| 339 | return "look-ahead"; |
| 340 | default: |
| 341 | return "unknown"; |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | static const char *remains_column_namecxx . . $ remains_column_name. = "remains"; |
| 346 | static const char *missings_column_namecxx . . $ missings_column_name. = "missings"; |
| 347 | |
| 348 | typedef structcxx . . $ $anonymous_type_512bede1a7d79c66_1# { |
| 349 | grn_idcxx . . $ grn_id# token_idcxx . . $ $anonymous_type_512bede1a7d79c66_1#token_id.; |
| 350 | grn_objcxx . . $ grn_obj# remainscxx . . $ $anonymous_type_512bede1a7d79c66_1#remains.; |
| 351 | grn_objcxx . . $ grn_obj# missingscxx . . $ $anonymous_type_512bede1a7d79c66_1#missings.; |
| 352 | grn_objcxx . . $ grn_obj# look_aheadcxx . . $ $anonymous_type_512bede1a7d79c66_1#look_ahead.; |
| 353 | size_t look_ahead_offsetcxx . . $ $anonymous_type_512bede1a7d79c66_1#look_ahead_offset.; |
| 354 | grn_postingcxx . . $ grn_posting# last_postingcxx . . $ $anonymous_type_512bede1a7d79c66_1#last_posting.; |
| 355 | grn_ii_cursorcxx . . $ grn_ii_cursor# *cursorcxx . . $ $anonymous_type_512bede1a7d79c66_1#cursor.; |
| 356 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! need_cursor_nextcxx . . $ $anonymous_type_512bede1a7d79c66_1#need_cursor_next.; |
| 357 | size_t n_postingscxx . . $ $anonymous_type_512bede1a7d79c66_1#n_postings.[N_GRN_INDEX_COLUMN_DIFF_PERSISTENT_TYPEScxx . . $ `lib/index_column.c:328:9`!]; |
| 358 | size_t thresholdscxx . . $ $anonymous_type_512bede1a7d79c66_1#thresholds.[N_GRN_INDEX_COLUMN_DIFF_PERSISTENT_TYPEScxx . . $ `lib/index_column.c:328:9`!]; |
| 359 | } grn_index_column_diff_posting_listcxx . . $ grn_index_column_diff_posting_list#; |
| 360 | |
| 361 | typedef structcxx . . $ $anonymous_type_512bede1a7d79c66_2# { |
| 362 | grn_index_column_diff_optionscxx . . $ grn_index_column_diff_options# *optionscxx . . $ $anonymous_type_512bede1a7d79c66_2#options.; |
| 363 | grn_objcxx . . $ grn_obj# *lexiconcxx . . $ $anonymous_type_512bede1a7d79c66_2#lexicon.; |
| 364 | grn_iicxx . . $ grn_ii# *iicxx . . $ $anonymous_type_512bede1a7d79c66_2#ii.; |
| 365 | structcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3# { |
| 366 | char namecxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#name.[GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!]; |
| 367 | int name_sizecxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#name_size.; |
| 368 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! with_sectioncxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#with_section.; |
| 369 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! with_positioncxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#with_position.; |
| 370 | uint32_tcxx . . $ uint32_t# n_elementscxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#n_elements.; |
| 371 | } indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index.; |
| 372 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! have_tokenizercxx . . $ $anonymous_type_512bede1a7d79c66_2#have_tokenizer.; |
| 373 | size_t n_posting_elementscxx . . $ $anonymous_type_512bede1a7d79c66_2#n_posting_elements.; |
| 374 | grn_objcxx . . $ grn_obj# *source_tablecxx . . $ $anonymous_type_512bede1a7d79c66_2#source_table.; |
| 375 | grn_objcxx . . $ grn_obj# source_columnscxx . . $ $anonymous_type_512bede1a7d79c66_2#source_columns.; |
| 376 | grn_objcxx . . $ grn_obj# *diffcxx . . $ $anonymous_type_512bede1a7d79c66_2#diff.; |
| 377 | grn_hashcxx . . $ grn_hash# *posting_listscxx . . $ $anonymous_type_512bede1a7d79c66_2#posting_lists.; |
| 378 | grn_objcxx . . $ grn_obj# *remainscxx . . $ $anonymous_type_512bede1a7d79c66_2#remains.; |
| 379 | grn_objcxx . . $ grn_obj# *missingscxx . . $ $anonymous_type_512bede1a7d79c66_2#missings.; |
| 380 | structcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4# { |
| 381 | grn_idcxx . . $ grn_id# token_idcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#token_id.; |
| 382 | grn_postingcxx . . $ grn_posting# postingcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#posting.; |
| 383 | grn_hashcxx . . $ grn_hash# *token_counterscxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#token_counters.; |
| 384 | } currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current.; |
| 385 | structcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_5# { |
| 386 | grn_objcxx . . $ grn_obj# valuecxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_5#value.; |
| 387 | grn_objcxx . . $ grn_obj# postingscxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_5#postings.; |
| 388 | } bufferscxx . . $ $anonymous_type_512bede1a7d79c66_2#buffers.; |
| 389 | structcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_6# { |
| 390 | grn_objcxx . . $ grn_obj# tagcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_6#tag.; |
| 391 | grn_progress_loggercxx . . $ grn_progress_logger# loggercxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_6#logger.; |
| 392 | } progresscxx . . $ $anonymous_type_512bede1a7d79c66_2#progress.; |
| 393 | } grn_index_column_diff_datacxx . . $ grn_index_column_diff_data#; |
| 394 | |
| 395 | static void |
| 396 | grn_index_column_diff_data_initcxx . . $ grn_index_column_diff_data_init(addfcda60cf01579).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 397 | grn_index_column_diff_datacxx . . $ grn_index_column_diff_data# *data, |
| 398 | grn_index_column_diff_optionscxx . . $ grn_index_column_diff_options# *options) |
| 399 | { |
| 400 | data->optionscxx . . $ $anonymous_type_512bede1a7d79c66_2#options. = options; |
| 401 | GRN_PTR_INITcxx . . $ `include/groonga/groonga.h:2869:9`!(&(data->source_columns), GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!, GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!); |
| 402 | GRN_VOID_INITcxx . . $ `include/groonga/groonga.h:2749:9`!(&(data->buffers.value)); |
| 403 | GRN_UINT32_INITcxx . . $ `include/groonga/groonga.h:2854:9`!(&(data->buffers.postings), GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!); |
| 404 | data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..token_counterscxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#token_counters. = grn_hash_createcxx . . $ grn_hash_create(db1bba7e0d64660).(ctx, |
| 405 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, |
| 406 | sizeof(grn_idcxx . . $ grn_id#), |
| 407 | sizeof(uint32_tcxx . . $ uint32_t#), |
| 408 | GRN_OBJ_TABLE_HASH_KEYcxx . . $ `include/groonga/groonga.h:688:9`!); |
| 409 | if (!data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..token_counterscxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#token_counters.) { |
| 410 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_NO_MEMORY_AVAILABLE, |
| 411 | "[index-column][diff] failed to create token counters"); |
| 412 | |
| 413 | GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &(data->source_columns)); |
| 414 | GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &(data->buffers.value)); |
| 415 | GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &(data->buffers.postings)); |
| 416 | } |
| 417 | } |
| 418 | |
| 419 | static void |
| 420 | grn_index_column_diff_data_fincxx . . $ grn_index_column_diff_data_fin(dae4f000c2b0d415).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_index_column_diff_datacxx . . $ grn_index_column_diff_data# *data) |
| 421 | { |
| 422 | { |
| 423 | size_t n_columns = GRN_PTR_VECTOR_SIZEcxx . . $ `include/groonga/groonga.h:3265:9`!(&(data->source_columns)); |
| 424 | for (size_t i = 0; i < n_columns; i++) { |
| 425 | grn_objcxx . . $ grn_obj# *column = GRN_PTR_VALUE_ATcxx . . $ `include/groonga/groonga.h:3150:9`!(&(data->source_columns), i); |
| 426 | if (grn_obj_is_accessorcxx . . $ grn_obj_is_accessor(a5760e5c319a06ee).(ctx, column)) { |
| 427 | grn_obj_closecxx . . $ grn_obj_close(4865d068a46d0f83).(ctx, column); |
| 428 | } |
| 429 | } |
| 430 | GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &(data->source_columns)); |
| 431 | } |
| 432 | |
| 433 | GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &(data->buffers.value)); |
| 434 | GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &(data->buffers.postings)); |
| 435 | grn_hash_closecxx . . $ grn_hash_close(c005d027d163fb0b).(ctx, data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..token_counterscxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#token_counters.); |
| 436 | GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &(data->progress.tag)); |
| 437 | } |
| 438 | |
| 439 | static void |
| 440 | grn_index_column_diff_init_progresscxx . . $ grn_index_column_diff_init_progress(dae4f000c2b0d415).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 441 | grn_index_column_diff_datacxx . . $ grn_index_column_diff_data# *data) |
| 442 | { |
| 443 | GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&(data->progress.tag), 0); |
| 444 | grn_text_printfcxx . . $ grn_text_printf(34596149d4dc0292).(ctx, |
| 445 | &(data->progresscxx . . $ $anonymous_type_512bede1a7d79c66_2#progress..tagcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_6#tag.), |
| 446 | "[index-column][diff][progress][%.*s]", |
| 447 | data->indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..name_sizecxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#name_size., |
| 448 | data->indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..namecxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#name.); |
| 449 | GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, &(data->progress.tag), '\0'); |
| 450 | grn_progress_logger_initcxx . . $ grn_progress_logger_init(3078940d0ac97cf3).(ctx, |
| 451 | &(data->progresscxx . . $ $anonymous_type_512bede1a7d79c66_2#progress..loggercxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_6#logger.), |
| 452 | GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(&(data->progress.tag)), |
| 453 | "records", |
| 454 | grn_table_sizecxx . . $ grn_table_size(8dd58acc9865e889).(ctx, data->source_tablecxx . . $ $anonymous_type_512bede1a7d79c66_2#source_table.)); |
| 455 | data->progresscxx . . $ $anonymous_type_512bede1a7d79c66_2#progress..loggercxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_6#logger..log_levelcxx . . $ grn_progress_logger#log_level. = |
| 456 | grn_index_column_diff_options_get_progress_log_levelcxx . . $ grn_index_column_diff_options_get_progress_log_level(4272edcfb765fb9).(ctx, data->optionscxx . . $ $anonymous_type_512bede1a7d79c66_2#options.); |
| 457 | } |
| 458 | |
| 459 | static void |
| 460 | grn_index_column_diff_progresscxx . . $ grn_index_column_diff_progress(dae4f000c2b0d415).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_index_column_diff_datacxx . . $ grn_index_column_diff_data# *data) |
| 461 | { |
| 462 | data->progresscxx . . $ $anonymous_type_512bede1a7d79c66_2#progress..loggercxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_6#logger..n_processed_targetscxx . . $ grn_progress_logger#n_processed_targets.++; |
| 463 | grn_progress_logger_logcxx . . $ grn_progress_logger_log(96a8a32589463576).(ctx, &(data->progresscxx . . $ $anonymous_type_512bede1a7d79c66_2#progress..loggercxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_6#logger.)); |
| 464 | } |
| 465 | |
| 466 | typedef enumcxx . . $ $anonymous_type_512bede1a7d79c66_7# { |
| 467 | GRN_INDEX_COLUMN_DIFF_COMPARED_EQUALcxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_EQUAL., |
| 468 | GRN_INDEX_COLUMN_DIFF_COMPARED_LESScxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_LESS., |
| 469 | GRN_INDEX_COLUMN_DIFF_COMPARED_GREATERcxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_GREATER., |
| 470 | } grn_index_column_diff_comparedcxx . . $ grn_index_column_diff_compared#; |
| 471 | |
| 472 | static char |
| 473 | grn_index_column_diff_compared_to_charcxx . . $ grn_index_column_diff_compared_to_char(7fa86cd7d1065879).(grn_index_column_diff_comparedcxx . . $ grn_index_column_diff_compared# compared) |
| 474 | { |
| 475 | switch (compared) { |
| 476 | case GRN_INDEX_COLUMN_DIFF_COMPARED_EQUALcxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_EQUAL.: |
| 477 | return '='; |
| 478 | case GRN_INDEX_COLUMN_DIFF_COMPARED_GREATERcxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_GREATER.: |
| 479 | return '>'; |
| 480 | case GRN_INDEX_COLUMN_DIFF_COMPARED_LESScxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_LESS.: |
| 481 | return '<'; |
| 482 | default: |
| 483 | return '?'; |
| 484 | } |
| 485 | } |
| 486 | |
| 487 | static grn_index_column_diff_comparedcxx . . $ grn_index_column_diff_compared# |
| 488 | grn_index_column_diff_compare_postingcxx . . $ grn_index_column_diff_compare_posting(d9850ec627137d97).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 489 | grn_index_column_diff_datacxx . . $ grn_index_column_diff_data# *data, |
| 490 | const grn_postingcxx . . $ grn_posting# *posting) |
| 491 | { |
| 492 | const boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! with_section = data->indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..with_sectioncxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#with_section.; |
| 493 | const boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! with_position = data->indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..with_positioncxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#with_position.; |
| 494 | const grn_postingcxx . . $ grn_posting# *current_posting = &(data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..postingcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#posting.); |
| 495 | |
| 496 | if (posting->ridcxx . . $ $anonymous_type_abfcd92361d8c963_0#rid. < current_posting->ridcxx . . $ $anonymous_type_abfcd92361d8c963_0#rid.) { |
| 497 | return GRN_INDEX_COLUMN_DIFF_COMPARED_LESScxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_LESS.; |
| 498 | } else if (posting->ridcxx . . $ $anonymous_type_abfcd92361d8c963_0#rid. > current_posting->ridcxx . . $ $anonymous_type_abfcd92361d8c963_0#rid.) { |
| 499 | return GRN_INDEX_COLUMN_DIFF_COMPARED_GREATERcxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_GREATER.; |
| 500 | } |
| 501 | |
| 502 | if (with_section) { |
| 503 | if (posting->sidcxx . . $ $anonymous_type_abfcd92361d8c963_0#sid. < current_posting->sidcxx . . $ $anonymous_type_abfcd92361d8c963_0#sid.) { |
| 504 | return GRN_INDEX_COLUMN_DIFF_COMPARED_LESScxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_LESS.; |
| 505 | } else if (posting->sidcxx . . $ $anonymous_type_abfcd92361d8c963_0#sid. > current_posting->sidcxx . . $ $anonymous_type_abfcd92361d8c963_0#sid.) { |
| 506 | return GRN_INDEX_COLUMN_DIFF_COMPARED_GREATERcxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_GREATER.; |
| 507 | } |
| 508 | } |
| 509 | |
| 510 | if (with_position) { |
| 511 | if (posting->poscxx . . $ $anonymous_type_abfcd92361d8c963_0#pos. < current_posting->poscxx . . $ $anonymous_type_abfcd92361d8c963_0#pos.) { |
| 512 | return GRN_INDEX_COLUMN_DIFF_COMPARED_LESScxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_LESS.; |
| 513 | } else if (posting->poscxx . . $ $anonymous_type_abfcd92361d8c963_0#pos. > current_posting->poscxx . . $ $anonymous_type_abfcd92361d8c963_0#pos.) { |
| 514 | return GRN_INDEX_COLUMN_DIFF_COMPARED_GREATERcxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_GREATER.; |
| 515 | } |
| 516 | } |
| 517 | |
| 518 | return GRN_INDEX_COLUMN_DIFF_COMPARED_EQUALcxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_EQUAL.; |
| 519 | } |
| 520 | |
| 521 | static int |
| 522 | grn_index_column_diff_token_id_widthcxx . . $ grn_index_column_diff_token_id_width(c5e9acdd23df6ae0).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 523 | grn_index_column_diff_datacxx . . $ grn_index_column_diff_data# *data) |
| 524 | { |
| 525 | unsigned int n_tokens = grn_table_sizecxx . . $ grn_table_size(8dd58acc9865e889).(ctx, data->lexiconcxx . . $ $anonymous_type_512bede1a7d79c66_2#lexicon.); |
| 526 | if (n_tokens == 0) { |
| 527 | return 0; |
| 528 | } else { |
| 529 | double width = floor(log10(n_tokens)) + 1; |
| 530 | return (int)width; |
| 531 | } |
| 532 | } |
| 533 | |
| 534 | static void |
| 535 | grn_index_column_diff_posting_list_initcxx . . $ grn_index_column_diff_posting_list_init(5963bf8650f65308).( |
| 536 | grn_ctxcxx . . $ grn_ctx# *ctx, |
| 537 | grn_index_column_diff_datacxx . . $ grn_index_column_diff_data# *data, |
| 538 | grn_index_column_diff_posting_listcxx . . $ grn_index_column_diff_posting_list# *posting_list) |
| 539 | { |
| 540 | posting_list->token_idcxx . . $ $anonymous_type_512bede1a7d79c66_1#token_id. = data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..token_idcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#token_id.; |
| 541 | GRN_UINT32_INITcxx . . $ `include/groonga/groonga.h:2854:9`!(&(posting_list->remains), GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!); |
| 542 | GRN_UINT32_INITcxx . . $ `include/groonga/groonga.h:2854:9`!(&(posting_list->missings), GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!); |
| 543 | GRN_UINT32_INITcxx . . $ `include/groonga/groonga.h:2854:9`!(&(posting_list->look_ahead), GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!); |
| 544 | posting_list->look_ahead_offsetcxx . . $ $anonymous_type_512bede1a7d79c66_1#look_ahead_offset. = 0; |
| 545 | posting_list->last_postingcxx . . $ $anonymous_type_512bede1a7d79c66_1#last_posting..tfcxx . . $ $anonymous_type_abfcd92361d8c963_0#tf. = 0; |
| 546 | |
| 547 | const int ii_cursor_flags = 0; |
| 548 | posting_list->cursorcxx . . $ $anonymous_type_512bede1a7d79c66_1#cursor. = grn_ii_cursor_opencxx . . $ grn_ii_cursor_open(5e1f33d5cbef52bd).(ctx, |
| 549 | data->iicxx . . $ $anonymous_type_512bede1a7d79c66_2#ii., |
| 550 | posting_list->token_idcxx . . $ $anonymous_type_512bede1a7d79c66_1#token_id., |
| 551 | GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!, |
| 552 | GRN_ID_MAXcxx . . $ `include/groonga/groonga.h:56:9`!, |
| 553 | (int)(data->indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..n_elementscxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#n_elements.), |
| 554 | ii_cursor_flags); |
| 555 | posting_list->need_cursor_nextcxx . . $ $anonymous_type_512bede1a7d79c66_1#need_cursor_next. = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!; |
| 556 | for (size_t i = 0; i < N_GRN_INDEX_COLUMN_DIFF_PERSISTENT_TYPEScxx . . $ `lib/index_column.c:328:9`!; i++) { |
| 557 | posting_list->n_postingscxx . . $ $anonymous_type_512bede1a7d79c66_1#n_postings.[i] = 0; |
| 558 | posting_list->thresholdscxx . . $ $anonymous_type_512bede1a7d79c66_1#thresholds.[i] = 4096; |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | static void |
| 563 | grn_index_column_diff_posting_list_flushcxx . . $ grn_index_column_diff_posting_list_flush(5963bf8650f65308).( |
| 564 | grn_ctxcxx . . $ grn_ctx# *ctx, |
| 565 | grn_index_column_diff_datacxx . . $ grn_index_column_diff_data# *data, |
| 566 | grn_index_column_diff_posting_listcxx . . $ grn_index_column_diff_posting_list# *posting_list) |
| 567 | { |
| 568 | grn_objcxx . . $ grn_obj# *remains = &(posting_list->remainscxx . . $ $anonymous_type_512bede1a7d79c66_1#remains.); |
| 569 | grn_objcxx . . $ grn_obj# *missings = &(posting_list->missingscxx . . $ $anonymous_type_512bede1a7d79c66_1#missings.); |
| 570 | { |
| 571 | grn_objcxx . . $ grn_obj# *look_ahead = &(posting_list->look_aheadcxx . . $ $anonymous_type_512bede1a7d79c66_1#look_ahead.); |
| 572 | const size_t offset = posting_list->look_ahead_offsetcxx . . $ $anonymous_type_512bede1a7d79c66_1#look_ahead_offset. * sizeof(uint32_tcxx . . $ uint32_t#); |
| 573 | grn_bulk_writecxx . . $ grn_bulk_write(4609c18fd87cf054).(ctx, |
| 574 | remains, |
| 575 | GRN_BULK_HEADcxx . . $ `include/groonga/groonga.h:2648:9`!(look_ahead) + offset, |
| 576 | GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(look_ahead) - offset); |
| 577 | } |
| 578 | |
| 579 | grn_ii_cursorcxx . . $ grn_ii_cursor# *cursor = posting_list->cursorcxx . . $ $anonymous_type_512bede1a7d79c66_1#cursor.; |
| 580 | if (cursor) { |
| 581 | const boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! with_section = data->indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..with_sectioncxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#with_section.; |
| 582 | const boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! with_position = data->indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..with_positioncxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#with_position.; |
| 583 | if (with_position) { |
| 584 | while (!posting_list->need_cursor_nextcxx . . $ $anonymous_type_512bede1a7d79c66_1#need_cursor_next. || |
| 585 | grn_ii_cursor_nextcxx . . $ grn_ii_cursor_next(2ca859fa2305fa5c).(ctx, cursor)) { |
| 586 | if (ctx->rccxx . . $ _grn_ctx#rc. != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 587 | return; |
| 588 | } |
| 589 | grn_postingcxx . . $ grn_posting# *posting; |
| 590 | while ((posting = grn_ii_cursor_next_poscxx . . $ grn_ii_cursor_next_pos(2ca859fa2305fa5c).(ctx, cursor))) { |
| 591 | if (ctx->rccxx . . $ _grn_ctx#rc. != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 592 | return; |
| 593 | } |
| 594 | posting_list->need_cursor_nextcxx . . $ $anonymous_type_512bede1a7d79c66_1#need_cursor_next. = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!; |
| 595 | GRN_UINT32_PUTcxx . . $ `include/groonga/groonga.h:3182:9`!(ctx, remains, posting->rid); |
| 596 | if (with_section) { |
| 597 | GRN_UINT32_PUTcxx . . $ `include/groonga/groonga.h:3182:9`!(ctx, remains, posting->sid); |
| 598 | } |
| 599 | GRN_UINT32_PUTcxx . . $ `include/groonga/groonga.h:3182:9`!(ctx, remains, posting->pos); |
| 600 | } |
| 601 | posting_list->need_cursor_nextcxx . . $ $anonymous_type_512bede1a7d79c66_1#need_cursor_next. = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!; |
| 602 | } |
| 603 | } else { |
| 604 | grn_postingcxx . . $ grn_posting# *posting; |
| 605 | while ((posting = grn_ii_cursor_nextcxx . . $ grn_ii_cursor_next(2ca859fa2305fa5c).(ctx, cursor))) { |
| 606 | if (ctx->rccxx . . $ _grn_ctx#rc. != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 607 | return; |
| 608 | } |
| 609 | GRN_UINT32_PUTcxx . . $ `include/groonga/groonga.h:3182:9`!(ctx, remains, posting->rid); |
| 610 | if (with_section) { |
| 611 | GRN_UINT32_PUTcxx . . $ `include/groonga/groonga.h:3182:9`!(ctx, remains, posting->sid); |
| 612 | } |
| 613 | } |
| 614 | } |
| 615 | } |
| 616 | |
| 617 | if (GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(remains) > 0 || GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(missings) > 0) { |
| 618 | const grn_idcxx . . $ grn_id# diff_id = grn_table_addcxx . . $ grn_table_add(8041cb9a4866097e).(ctx, |
| 619 | data->diffcxx . . $ $anonymous_type_512bede1a7d79c66_2#diff., |
| 620 | &(posting_list->token_idcxx . . $ $anonymous_type_512bede1a7d79c66_1#token_id.), |
| 621 | sizeof(grn_idcxx . . $ grn_id#), |
| 622 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 623 | if (diff_id != GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) { |
| 624 | if (GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(remains) > 0) { |
| 625 | grn_obj_set_valuecxx . . $ grn_obj_set_value(16170250441fe8eb).(ctx, data->remainscxx . . $ $anonymous_type_512bede1a7d79c66_2#remains., diff_id, remains, GRN_OBJ_APPENDcxx . . $ `include/groonga/groonga.h:1478:9`!); |
| 626 | } |
| 627 | if (GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(missings) > 0) { |
| 628 | grn_obj_set_valuecxx . . $ grn_obj_set_value(16170250441fe8eb).(ctx, |
| 629 | data->missingscxx . . $ $anonymous_type_512bede1a7d79c66_2#missings., |
| 630 | diff_id, |
| 631 | missings, |
| 632 | GRN_OBJ_APPENDcxx . . $ `include/groonga/groonga.h:1478:9`!); |
| 633 | } |
| 634 | } |
| 635 | } |
| 636 | } |
| 637 | |
| 638 | static void |
| 639 | grn_index_column_diff_posting_list_fincxx . . $ grn_index_column_diff_posting_list_fin(5963bf8650f65308).( |
| 640 | grn_ctxcxx . . $ grn_ctx# *ctx, |
| 641 | grn_index_column_diff_datacxx . . $ grn_index_column_diff_data# *data, |
| 642 | grn_index_column_diff_posting_listcxx . . $ grn_index_column_diff_posting_list# *posting_list) |
| 643 | { |
| 644 | if (ctx->rccxx . . $ _grn_ctx#rc. == GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 645 | grn_index_column_diff_posting_list_flushcxx . . $ grn_index_column_diff_posting_list_flush(5963bf8650f65308).(ctx, data, posting_list); |
| 646 | } |
| 647 | GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &(posting_list->remains)); |
| 648 | GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &(posting_list->missings)); |
| 649 | GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &(posting_list->look_ahead)); |
| 650 | if (posting_list->cursorcxx . . $ $anonymous_type_512bede1a7d79c66_1#cursor.) { |
| 651 | grn_ii_cursor_closecxx . . $ grn_ii_cursor_close(9f30b86a43abe2c6).(ctx, posting_list->cursorcxx . . $ $anonymous_type_512bede1a7d79c66_1#cursor.); |
| 652 | posting_list->cursorcxx . . $ $anonymous_type_512bede1a7d79c66_1#cursor. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 653 | } |
| 654 | } |
| 655 | |
| 656 | static void |
| 657 | grn_index_column_diff_posting_list_putcxx . . $ grn_index_column_diff_posting_list_put(6f70024ca7ada5b7).( |
| 658 | grn_ctxcxx . . $ grn_ctx# *ctx, |
| 659 | grn_index_column_diff_datacxx . . $ grn_index_column_diff_data# *data, |
| 660 | grn_index_column_diff_posting_listcxx . . $ grn_index_column_diff_posting_list# *posting_list, |
| 661 | grn_index_column_diff_typecxx . . $ grn_index_column_diff_type# type, |
| 662 | const grn_postingcxx . . $ grn_posting# *posting) |
| 663 | { |
| 664 | grn_objcxx . . $ grn_obj# *column; |
| 665 | grn_objcxx . . $ grn_obj# *postings; |
| 666 | switch (type) { |
| 667 | case GRN_INDEX_COLUMN_DIFF_TYPE_REMAINScxx . . $ GRN_INDEX_COLUMN_DIFF_TYPE_REMAINS.: |
| 668 | column = data->remainscxx . . $ $anonymous_type_512bede1a7d79c66_2#remains.; |
| 669 | postings = &(posting_list->remainscxx . . $ $anonymous_type_512bede1a7d79c66_1#remains.); |
| 670 | break; |
| 671 | case GRN_INDEX_COLUMN_DIFF_TYPE_MISSINGScxx . . $ GRN_INDEX_COLUMN_DIFF_TYPE_MISSINGS.: |
| 672 | column = data->missingscxx . . $ $anonymous_type_512bede1a7d79c66_2#missings.; |
| 673 | postings = &(posting_list->missingscxx . . $ $anonymous_type_512bede1a7d79c66_1#missings.); |
| 674 | break; |
| 675 | default: |
| 676 | column = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 677 | postings = &(posting_list->look_aheadcxx . . $ $anonymous_type_512bede1a7d79c66_1#look_ahead.); |
| 678 | break; |
| 679 | } |
| 680 | |
| 681 | GRN_UINT32_PUTcxx . . $ `include/groonga/groonga.h:3182:9`!(ctx, postings, posting->rid); |
| 682 | if (data->indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..with_sectioncxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#with_section.) { |
| 683 | GRN_UINT32_PUTcxx . . $ `include/groonga/groonga.h:3182:9`!(ctx, postings, posting->sid); |
| 684 | } |
| 685 | if (data->indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..with_positioncxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#with_position.) { |
| 686 | GRN_UINT32_PUTcxx . . $ `include/groonga/groonga.h:3182:9`!(ctx, postings, posting->pos); |
| 687 | } |
| 688 | |
| 689 | if (!column) { |
| 690 | return; |
| 691 | } |
| 692 | |
| 693 | posting_list->n_postingscxx . . $ $anonymous_type_512bede1a7d79c66_1#n_postings.[type]++; |
| 694 | const size_t current_n_postings = |
| 695 | GRN_UINT32_VECTOR_SIZEcxx . . $ `include/groonga/groonga.h:3257:9`!(postings) / data->n_posting_elementscxx . . $ $anonymous_type_512bede1a7d79c66_2#n_posting_elements.; |
| 696 | if (current_n_postings < posting_list->thresholdscxx . . $ $anonymous_type_512bede1a7d79c66_1#thresholds.[type]) { |
| 697 | return; |
| 698 | } |
| 699 | |
| 700 | const grn_idcxx . . $ grn_id# diff_id = grn_table_addcxx . . $ grn_table_add(8041cb9a4866097e).(ctx, |
| 701 | data->diffcxx . . $ $anonymous_type_512bede1a7d79c66_2#diff., |
| 702 | &(posting_list->token_idcxx . . $ $anonymous_type_512bede1a7d79c66_1#token_id.), |
| 703 | sizeof(grn_idcxx . . $ grn_id#), |
| 704 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 705 | if (diff_id == GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) { |
| 706 | return; |
| 707 | } |
| 708 | grn_obj_set_valuecxx . . $ grn_obj_set_value(16170250441fe8eb).(ctx, column, diff_id, postings, GRN_OBJ_APPENDcxx . . $ `include/groonga/groonga.h:1478:9`!); |
| 709 | if (ctx->rccxx . . $ _grn_ctx#rc. == GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 710 | GRN_BULK_REWINDcxx . . $ `include/groonga/groonga.h:2599:9`!(postings); |
| 711 | } |
| 712 | posting_list->thresholdscxx . . $ $anonymous_type_512bede1a7d79c66_1#thresholds.[type] *= 2; |
| 713 | GRN_LOGcxx . . $ `include/groonga/groonga.h:2493:9`!(ctx, |
| 714 | GRN_LOG_DUMP, |
| 715 | "[index-column][diff][append][%.*s][%u][%*s] " |
| 716 | "%" GRN_FMT_SIZEcxx . . $ `lib/grn.h:408:11`! "(+%" GRN_FMT_SIZEcxx . . $ `lib/grn.h:408:11`! ")", |
| 717 | data->index.name_size, |
| 718 | data->index.name, |
| 719 | grn_index_column_diff_token_id_width(ctx, data), |
| 720 | data->current.token_id, |
| 721 | grn_index_column_diff_type_to_string(type), |
| 722 | posting_list->n_postings[type], |
| 723 | current_n_postings); |
| 724 | } |
| 725 | |
| 726 | static void |
| 727 | grn_index_column_diff_posting_list_consume_look_aheadcxx . . $ grn_index_column_diff_posting_list_consume_look_ahead(5963bf8650f65308).( |
| 728 | grn_ctxcxx . . $ grn_ctx# *ctx, |
| 729 | grn_index_column_diff_datacxx . . $ grn_index_column_diff_data# *data, |
| 730 | grn_index_column_diff_posting_listcxx . . $ grn_index_column_diff_posting_list# *posting_list) |
| 731 | { |
| 732 | grn_objcxx . . $ grn_obj# *look_ahead = &(posting_list->look_aheadcxx . . $ $anonymous_type_512bede1a7d79c66_1#look_ahead.); |
| 733 | posting_list->look_ahead_offsetcxx . . $ $anonymous_type_512bede1a7d79c66_1#look_ahead_offset.++; |
| 734 | if (posting_list->look_ahead_offsetcxx . . $ $anonymous_type_512bede1a7d79c66_1#look_ahead_offset. == |
| 735 | (GRN_UINT32_VECTOR_SIZEcxx . . $ `include/groonga/groonga.h:3257:9`!(look_ahead) / data->n_posting_elementscxx . . $ $anonymous_type_512bede1a7d79c66_2#n_posting_elements.)) { |
| 736 | GRN_BULK_REWINDcxx . . $ `include/groonga/groonga.h:2599:9`!(look_ahead); |
| 737 | posting_list->look_ahead_offsetcxx . . $ $anonymous_type_512bede1a7d79c66_1#look_ahead_offset. = 0; |
| 738 | } |
| 739 | } |
| 740 | |
| 741 | static void |
| 742 | grn_index_column_diff_process_token_idcxx . . $ grn_index_column_diff_process_token_id(dae4f000c2b0d415).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 743 | grn_index_column_diff_datacxx . . $ grn_index_column_diff_data# *data) |
| 744 | { |
| 745 | { |
| 746 | void *value = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 747 | int added = 0; |
| 748 | const grn_idcxx . . $ grn_id# token_counter_id = grn_hash_addcxx . . $ grn_hash_add(251a256fc515235e).(ctx, |
| 749 | data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..token_counterscxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#token_counters., |
| 750 | &(data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..token_idcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#token_id.), |
| 751 | sizeof(grn_idcxx . . $ grn_id#), |
| 752 | &value, |
| 753 | &added); |
| 754 | if (token_counter_id == GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) { |
| 755 | grn_rccxx . . $ grn_rc# rc = ctx->rccxx . . $ _grn_ctx#rc.; |
| 756 | if (rc == GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 757 | rc = GRN_UNKNOWN_ERRORcxx . . $ GRN_UNKNOWN_ERROR.; |
| 758 | } |
| 759 | char message[GRN_CTX_MSGSIZEcxx . . $ `include/groonga/groonga.h:334:9`!]; |
| 760 | grn_strcpycxx . . $ `include/groonga/portability.h:101:11`!(message, GRN_CTX_MSGSIZE, ctx->errbuf); |
| 761 | ERRcxx . . $ `lib/grn_error.h:156:9`!(rc, |
| 762 | "[index-column][diff] failed to add a token counter: " |
| 763 | "<%.*s>: %u: %s", |
| 764 | data->index.name_size, |
| 765 | data->index.name, |
| 766 | data->current.token_id, |
| 767 | message); |
| 768 | return; |
| 769 | } |
| 770 | |
| 771 | uint32_tcxx . . $ uint32_t# *token_counter = value; |
| 772 | if (added) { |
| 773 | *token_counter = 0; |
| 774 | } else { |
| 775 | (*token_counter)++; |
| 776 | } |
| 777 | |
| 778 | if (*token_counter >= GRN_II_MAX_TFcxx . . $ `lib/grn_ii.h:87:9`!) { |
| 779 | return; |
| 780 | } |
| 781 | } |
| 782 | |
| 783 | void *value = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 784 | int added = 0; |
| 785 | const grn_idcxx . . $ grn_id# posting_list_id = grn_hash_addcxx . . $ grn_hash_add(251a256fc515235e).(ctx, |
| 786 | data->posting_listscxx . . $ $anonymous_type_512bede1a7d79c66_2#posting_lists., |
| 787 | &(data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..token_idcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#token_id.), |
| 788 | sizeof(grn_idcxx . . $ grn_id#), |
| 789 | &value, |
| 790 | &added); |
| 791 | if (posting_list_id == GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) { |
| 792 | grn_rccxx . . $ grn_rc# rc = ctx->rccxx . . $ _grn_ctx#rc.; |
| 793 | if (rc == GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 794 | rc = GRN_UNKNOWN_ERRORcxx . . $ GRN_UNKNOWN_ERROR.; |
| 795 | } |
| 796 | char message[GRN_CTX_MSGSIZEcxx . . $ `include/groonga/groonga.h:334:9`!]; |
| 797 | grn_strcpycxx . . $ `include/groonga/portability.h:101:11`!(message, GRN_CTX_MSGSIZE, ctx->errbuf); |
| 798 | ERRcxx . . $ `lib/grn_error.h:156:9`!(rc, |
| 799 | "[index-column][diff] failed to add a record to keep a posting list: " |
| 800 | "%u: %s", |
| 801 | data->current.token_id, |
| 802 | message); |
| 803 | return; |
| 804 | } |
| 805 | |
| 806 | grn_index_column_diff_posting_listcxx . . $ grn_index_column_diff_posting_list# *posting_list = value; |
| 807 | if (added) { |
| 808 | grn_index_column_diff_posting_list_initcxx . . $ grn_index_column_diff_posting_list_init(5963bf8650f65308).(ctx, data, posting_list); |
| 809 | } |
| 810 | |
| 811 | const boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! with_section = data->indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..with_sectioncxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#with_section.; |
| 812 | const boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! with_position = data->indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..with_positioncxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#with_position.; |
| 813 | |
| 814 | if (posting_list->last_postingcxx . . $ $anonymous_type_512bede1a7d79c66_1#last_posting..tfcxx . . $ $anonymous_type_abfcd92361d8c963_0#tf. > 0) { |
| 815 | const grn_index_column_diff_comparedcxx . . $ grn_index_column_diff_compared# compared = |
| 816 | grn_index_column_diff_compare_postingcxx . . $ grn_index_column_diff_compare_posting(d9850ec627137d97).(ctx, |
| 817 | data, |
| 818 | &(posting_list->last_postingcxx . . $ $anonymous_type_512bede1a7d79c66_1#last_posting.)); |
| 819 | GRN_LOGcxx . . $ `include/groonga/groonga.h:2493:9`!(ctx, |
| 820 | GRN_LOG_DUMP, |
| 821 | "[index-column][diff][process][%.*s][%*u] " |
| 822 | " last[%u:%u:%u:%u] %c current[%u:%u:%u]", |
| 823 | data->index.name_size, |
| 824 | data->index.name, |
| 825 | grn_index_column_diff_token_id_width(ctx, data), |
| 826 | data->current.token_id, |
| 827 | posting_list->last_posting.rid, |
| 828 | posting_list->last_posting.sid, |
| 829 | posting_list->last_posting.pos, |
| 830 | posting_list->last_posting.tf, |
| 831 | grn_index_column_diff_compared_to_char(compared), |
| 832 | data->current.posting.rid, |
| 833 | data->current.posting.sid, |
| 834 | data->current.posting.pos); |
| 835 | if (compared == GRN_INDEX_COLUMN_DIFF_COMPARED_EQUALcxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_EQUAL.) { |
| 836 | posting_list->last_postingcxx . . $ $anonymous_type_512bede1a7d79c66_1#last_posting..tfcxx . . $ $anonymous_type_abfcd92361d8c963_0#tf.--; |
| 837 | return; |
| 838 | } else { |
| 839 | posting_list->last_postingcxx . . $ $anonymous_type_512bede1a7d79c66_1#last_posting..tfcxx . . $ $anonymous_type_abfcd92361d8c963_0#tf. = 0; |
| 840 | } |
| 841 | } |
| 842 | |
| 843 | grn_objcxx . . $ grn_obj# *look_ahead = &(posting_list->look_aheadcxx . . $ $anonymous_type_512bede1a7d79c66_1#look_ahead.); |
| 844 | const size_t look_ahead_offset = posting_list->look_ahead_offsetcxx . . $ $anonymous_type_512bede1a7d79c66_1#look_ahead_offset.; |
| 845 | |
| 846 | const size_t n_posting_elements = data->n_posting_elementscxx . . $ $anonymous_type_512bede1a7d79c66_2#n_posting_elements.; |
| 847 | const size_t n_postings = |
| 848 | GRN_UINT32_VECTOR_SIZEcxx . . $ `include/groonga/groonga.h:3257:9`!(look_ahead) / n_posting_elements; |
| 849 | const uint32_tcxx . . $ uint32_t# *raw_postings = (const uint32_tcxx . . $ uint32_t# *)GRN_BULK_HEADcxx . . $ `include/groonga/groonga.h:2648:9`!(look_ahead); |
| 850 | for (size_t i = look_ahead_offset; i < n_postings; i++) { |
| 851 | const size_t offset = i * data->n_posting_elementscxx . . $ $anonymous_type_512bede1a7d79c66_2#n_posting_elements.; |
| 852 | const uint32_tcxx . . $ uint32_t# *raw_posting = raw_postings + offset; |
| 853 | grn_postingcxx . . $ grn_posting# posting = {0}; |
| 854 | size_t i = 0; |
| 855 | posting.ridcxx . . $ $anonymous_type_abfcd92361d8c963_0#rid. = raw_posting[i++]; |
| 856 | if (with_section) { |
| 857 | posting.sidcxx . . $ $anonymous_type_abfcd92361d8c963_0#sid. = raw_posting[i++]; |
| 858 | } |
| 859 | if (with_position) { |
| 860 | posting.poscxx . . $ $anonymous_type_abfcd92361d8c963_0#pos. = raw_posting[i++]; |
| 861 | } |
| 862 | const grn_index_column_diff_comparedcxx . . $ grn_index_column_diff_compared# compared = |
| 863 | grn_index_column_diff_compare_postingcxx . . $ grn_index_column_diff_compare_posting(d9850ec627137d97).(ctx, data, &posting); |
| 864 | GRN_LOGcxx . . $ `include/groonga/groonga.h:2493:9`!(ctx, |
| 865 | GRN_LOG_DUMP, |
| 866 | "[index-column][diff][process][%.*s][%*u] " |
| 867 | "look-ahead[%u:%u:%u] %c current[%u:%u:%u]", |
| 868 | data->index.name_size, |
| 869 | data->index.name, |
| 870 | grn_index_column_diff_token_id_width(ctx, data), |
| 871 | data->current.token_id, |
| 872 | posting.rid, |
| 873 | posting.sid, |
| 874 | posting.pos, |
| 875 | grn_index_column_diff_compared_to_char(compared), |
| 876 | data->current.posting.rid, |
| 877 | data->current.posting.sid, |
| 878 | data->current.posting.pos); |
| 879 | switch (compared) { |
| 880 | case GRN_INDEX_COLUMN_DIFF_COMPARED_EQUALcxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_EQUAL.: |
| 881 | grn_index_column_diff_posting_list_consume_look_aheadcxx . . $ grn_index_column_diff_posting_list_consume_look_ahead(5963bf8650f65308).(ctx, |
| 882 | data, |
| 883 | posting_list); |
| 884 | return; |
| 885 | case GRN_INDEX_COLUMN_DIFF_COMPARED_GREATERcxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_GREATER.: |
| 886 | grn_index_column_diff_posting_list_putcxx . . $ grn_index_column_diff_posting_list_put(6f70024ca7ada5b7).( |
| 887 | ctx, |
| 888 | data, |
| 889 | posting_list, |
| 890 | GRN_INDEX_COLUMN_DIFF_TYPE_MISSINGScxx . . $ GRN_INDEX_COLUMN_DIFF_TYPE_MISSINGS., |
| 891 | &(data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..postingcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#posting.)); |
| 892 | return; |
| 893 | default: |
| 894 | grn_index_column_diff_posting_list_putcxx . . $ grn_index_column_diff_posting_list_put(6f70024ca7ada5b7).(ctx, |
| 895 | data, |
| 896 | posting_list, |
| 897 | GRN_INDEX_COLUMN_DIFF_TYPE_REMAINScxx . . $ GRN_INDEX_COLUMN_DIFF_TYPE_REMAINS., |
| 898 | &posting); |
| 899 | grn_index_column_diff_posting_list_consume_look_aheadcxx . . $ grn_index_column_diff_posting_list_consume_look_ahead(5963bf8650f65308).(ctx, |
| 900 | data, |
| 901 | posting_list); |
| 902 | break; |
| 903 | } |
| 904 | } |
| 905 | |
| 906 | grn_ii_cursorcxx . . $ grn_ii_cursor# *cursor = posting_list->cursorcxx . . $ $anonymous_type_512bede1a7d79c66_1#cursor.; |
| 907 | if (cursor) { |
| 908 | if (with_position) { |
| 909 | while (!posting_list->need_cursor_nextcxx . . $ $anonymous_type_512bede1a7d79c66_1#need_cursor_next. || |
| 910 | grn_ii_cursor_nextcxx . . $ grn_ii_cursor_next(2ca859fa2305fa5c).(ctx, cursor)) { |
| 911 | if (ctx->rccxx . . $ _grn_ctx#rc. != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 912 | return; |
| 913 | } |
| 914 | grn_postingcxx . . $ grn_posting# *posting; |
| 915 | while ((posting = grn_ii_cursor_next_poscxx . . $ grn_ii_cursor_next_pos(2ca859fa2305fa5c).(ctx, cursor))) { |
| 916 | if (ctx->rccxx . . $ _grn_ctx#rc. != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 917 | return; |
| 918 | } |
| 919 | posting_list->need_cursor_nextcxx . . $ $anonymous_type_512bede1a7d79c66_1#need_cursor_next. = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!; |
| 920 | const grn_index_column_diff_comparedcxx . . $ grn_index_column_diff_compared# compared = |
| 921 | grn_index_column_diff_compare_postingcxx . . $ grn_index_column_diff_compare_posting(d9850ec627137d97).(ctx, data, posting); |
| 922 | GRN_LOGcxx . . $ `include/groonga/groonga.h:2493:9`!(ctx, |
| 923 | GRN_LOG_DUMP, |
| 924 | "[index-column][diff][process][%.*s][%*u] " |
| 925 | " read[%u:%u:%u] %c current[%u:%u:%u]", |
| 926 | data->index.name_size, |
| 927 | data->index.name, |
| 928 | grn_index_column_diff_token_id_width(ctx, data), |
| 929 | data->current.token_id, |
| 930 | posting->rid, |
| 931 | posting->sid, |
| 932 | posting->pos, |
| 933 | grn_index_column_diff_compared_to_char(compared), |
| 934 | data->current.posting.rid, |
| 935 | data->current.posting.sid, |
| 936 | data->current.posting.pos); |
| 937 | switch (compared) { |
| 938 | case GRN_INDEX_COLUMN_DIFF_COMPARED_EQUALcxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_EQUAL.: |
| 939 | return; |
| 940 | case GRN_INDEX_COLUMN_DIFF_COMPARED_GREATERcxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_GREATER.: |
| 941 | grn_index_column_diff_posting_list_putcxx . . $ grn_index_column_diff_posting_list_put(6f70024ca7ada5b7).( |
| 942 | ctx, |
| 943 | data, |
| 944 | posting_list, |
| 945 | GRN_INDEX_COLUMN_DIFF_TYPE_LOOK_AHEADcxx . . $ GRN_INDEX_COLUMN_DIFF_TYPE_LOOK_AHEAD., |
| 946 | posting); |
| 947 | grn_index_column_diff_posting_list_putcxx . . $ grn_index_column_diff_posting_list_put(6f70024ca7ada5b7).( |
| 948 | ctx, |
| 949 | data, |
| 950 | posting_list, |
| 951 | GRN_INDEX_COLUMN_DIFF_TYPE_MISSINGScxx . . $ GRN_INDEX_COLUMN_DIFF_TYPE_MISSINGS., |
| 952 | &(data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..postingcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#posting.)); |
| 953 | return; |
| 954 | default: |
| 955 | grn_index_column_diff_posting_list_putcxx . . $ grn_index_column_diff_posting_list_put(6f70024ca7ada5b7).( |
| 956 | ctx, |
| 957 | data, |
| 958 | posting_list, |
| 959 | GRN_INDEX_COLUMN_DIFF_TYPE_REMAINScxx . . $ GRN_INDEX_COLUMN_DIFF_TYPE_REMAINS., |
| 960 | posting); |
| 961 | break; |
| 962 | } |
| 963 | } |
| 964 | posting_list->need_cursor_nextcxx . . $ $anonymous_type_512bede1a7d79c66_1#need_cursor_next. = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!; |
| 965 | } |
| 966 | } else { |
| 967 | grn_postingcxx . . $ grn_posting# *posting; |
| 968 | while ((posting = grn_ii_cursor_nextcxx . . $ grn_ii_cursor_next(2ca859fa2305fa5c).(ctx, cursor))) { |
| 969 | if (ctx->rccxx . . $ _grn_ctx#rc. != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 970 | return; |
| 971 | } |
| 972 | const grn_index_column_diff_comparedcxx . . $ grn_index_column_diff_compared# compared = |
| 973 | grn_index_column_diff_compare_postingcxx . . $ grn_index_column_diff_compare_posting(d9850ec627137d97).(ctx, data, posting); |
| 974 | GRN_LOGcxx . . $ `include/groonga/groonga.h:2493:9`!(ctx, |
| 975 | GRN_LOG_DUMP, |
| 976 | "[index-column][diff][process][%.*s][%*u] " |
| 977 | " read[%u:%u:%u:%u] %c current[%u:%u:%u]", |
| 978 | data->index.name_size, |
| 979 | data->index.name, |
| 980 | grn_index_column_diff_token_id_width(ctx, data), |
| 981 | data->current.token_id, |
| 982 | posting->rid, |
| 983 | posting->sid, |
| 984 | posting->pos, |
| 985 | posting->tf, |
| 986 | grn_index_column_diff_compared_to_char(compared), |
| 987 | data->current.posting.rid, |
| 988 | data->current.posting.sid, |
| 989 | data->current.posting.pos); |
| 990 | switch (compared) { |
| 991 | case GRN_INDEX_COLUMN_DIFF_COMPARED_EQUALcxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_EQUAL.: |
| 992 | if (!with_position && posting->tfcxx . . $ $anonymous_type_abfcd92361d8c963_0#tf. > 0) { |
| 993 | posting_list->last_postingcxx . . $ $anonymous_type_512bede1a7d79c66_1#last_posting. = *posting; |
| 994 | posting_list->last_postingcxx . . $ $anonymous_type_512bede1a7d79c66_1#last_posting..tfcxx . . $ $anonymous_type_abfcd92361d8c963_0#tf.--; |
| 995 | } |
| 996 | return; |
| 997 | case GRN_INDEX_COLUMN_DIFF_COMPARED_GREATERcxx . . $ GRN_INDEX_COLUMN_DIFF_COMPARED_GREATER.: |
| 998 | grn_index_column_diff_posting_list_putcxx . . $ grn_index_column_diff_posting_list_put(6f70024ca7ada5b7).( |
| 999 | ctx, |
| 1000 | data, |
| 1001 | posting_list, |
| 1002 | GRN_INDEX_COLUMN_DIFF_TYPE_LOOK_AHEADcxx . . $ GRN_INDEX_COLUMN_DIFF_TYPE_LOOK_AHEAD., |
| 1003 | posting); |
| 1004 | grn_index_column_diff_posting_list_putcxx . . $ grn_index_column_diff_posting_list_put(6f70024ca7ada5b7).( |
| 1005 | ctx, |
| 1006 | data, |
| 1007 | posting_list, |
| 1008 | GRN_INDEX_COLUMN_DIFF_TYPE_MISSINGScxx . . $ GRN_INDEX_COLUMN_DIFF_TYPE_MISSINGS., |
| 1009 | &(data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..postingcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#posting.)); |
| 1010 | return; |
| 1011 | default: |
| 1012 | grn_index_column_diff_posting_list_putcxx . . $ grn_index_column_diff_posting_list_put(6f70024ca7ada5b7).( |
| 1013 | ctx, |
| 1014 | data, |
| 1015 | posting_list, |
| 1016 | GRN_INDEX_COLUMN_DIFF_TYPE_REMAINScxx . . $ GRN_INDEX_COLUMN_DIFF_TYPE_REMAINS., |
| 1017 | posting); |
| 1018 | break; |
| 1019 | } |
| 1020 | } |
| 1021 | } |
| 1022 | } |
| 1023 | |
| 1024 | GRN_LOGcxx . . $ `include/groonga/groonga.h:2493:9`!(ctx, |
| 1025 | GRN_LOG_DUMP, |
| 1026 | "[index-column][diff][process][%.*s][%*u] " |
| 1027 | " no posting list: current[%u:%u:%u]", |
| 1028 | data->index.name_size, |
| 1029 | data->index.name, |
| 1030 | grn_index_column_diff_token_id_width(ctx, data), |
| 1031 | data->current.token_id, |
| 1032 | data->current.posting.rid, |
| 1033 | data->current.posting.sid, |
| 1034 | data->current.posting.pos); |
| 1035 | grn_index_column_diff_posting_list_putcxx . . $ grn_index_column_diff_posting_list_put(6f70024ca7ada5b7).(ctx, |
| 1036 | data, |
| 1037 | posting_list, |
| 1038 | GRN_INDEX_COLUMN_DIFF_TYPE_MISSINGScxx . . $ GRN_INDEX_COLUMN_DIFF_TYPE_MISSINGS., |
| 1039 | &(data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..postingcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#posting.)); |
| 1040 | } |
| 1041 | |
| 1042 | static void |
| 1043 | grn_index_column_diff_process_tokencxx . . $ grn_index_column_diff_process_token(37d1ab8cb06460b9).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 1044 | grn_index_column_diff_datacxx . . $ grn_index_column_diff_data# *data, |
| 1045 | const void *value_data, |
| 1046 | size_t value_size, |
| 1047 | grn_idcxx . . $ grn_id# value_domain) |
| 1048 | { |
| 1049 | if (value_size == 0) { |
| 1050 | return; |
| 1051 | } |
| 1052 | |
| 1053 | const unsigned int token_cursor_flags = 0; |
| 1054 | grn_token_cursorcxx . . $ grn_token_cursor# *token_cursor = grn_token_cursor_opencxx . . $ grn_token_cursor_open(b521006a1987c493).(ctx, |
| 1055 | data->lexiconcxx . . $ $anonymous_type_512bede1a7d79c66_2#lexicon., |
| 1056 | value_data, |
| 1057 | value_size, |
| 1058 | GRN_TOKEN_ADDcxx . . $ `include/groonga/token.h:59:9`!, |
| 1059 | token_cursor_flags); |
| 1060 | if (!token_cursor) { |
| 1061 | return; |
| 1062 | } |
| 1063 | |
| 1064 | grn_token_cursor_set_query_domaincxx . . $ grn_token_cursor_set_query_domain(fe988a01052ed552).(ctx, token_cursor, value_domain); |
| 1065 | |
| 1066 | const boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! with_position = data->indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..with_positioncxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#with_position.; |
| 1067 | while (grn_token_cursor_get_statuscxx . . $ grn_token_cursor_get_status(4be9deca176a28c7).(ctx, token_cursor) == |
| 1068 | GRN_TOKEN_CURSOR_DOINGcxx . . $ GRN_TOKEN_CURSOR_DOING.) { |
| 1069 | data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..token_idcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#token_id. = grn_token_cursor_nextcxx . . $ grn_token_cursor_next(60c29d5cf5463368).(ctx, token_cursor); |
| 1070 | if (data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..token_idcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#token_id. == GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) { |
| 1071 | continue; |
| 1072 | } |
| 1073 | |
| 1074 | if (with_position && data->have_tokenizercxx . . $ $anonymous_type_512bede1a7d79c66_2#have_tokenizer.) { |
| 1075 | grn_tokencxx . . $ grn_token# *token = grn_token_cursor_get_tokencxx . . $ grn_token_cursor_get_token(42eb6886c4ba0dd1).(ctx, token_cursor); |
| 1076 | data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..postingcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#posting..poscxx . . $ $anonymous_type_abfcd92361d8c963_0#pos. = grn_token_get_positioncxx . . $ grn_token_get_position(e181e4c8cedfccbf).(ctx, token); |
| 1077 | } |
| 1078 | |
| 1079 | grn_index_column_diff_process_token_idcxx . . $ grn_index_column_diff_process_token_id(dae4f000c2b0d415).(ctx, data); |
| 1080 | if (ctx->rccxx . . $ _grn_ctx#rc. != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 1081 | break; |
| 1082 | } |
| 1083 | } |
| 1084 | grn_token_cursor_closecxx . . $ grn_token_cursor_close(fbd52f00bdc6c9ff).(ctx, token_cursor); |
| 1085 | } |
| 1086 | |
| 1087 | static void |
| 1088 | grn_index_column_diff_computecxx . . $ grn_index_column_diff_compute(dae4f000c2b0d415).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_index_column_diff_datacxx . . $ grn_index_column_diff_data# *data) |
| 1089 | { |
| 1090 | grn_objcxx . . $ grn_obj# *source_columns = &(data->source_columnscxx . . $ $anonymous_type_512bede1a7d79c66_2#source_columns.); |
| 1091 | const size_t n_source_columns = GRN_PTR_VECTOR_SIZEcxx . . $ `include/groonga/groonga.h:3265:9`!(source_columns); |
| 1092 | |
| 1093 | grn_index_column_diff_init_progresscxx . . $ grn_index_column_diff_init_progress(dae4f000c2b0d415).(ctx, data); |
| 1094 | |
| 1095 | GRN_TABLE_EACH_BEGIN_FLAGScxx . . $ `include/groonga/table.h:631:9`!(ctx, |
| 1096 | data->source_table, |
| 1097 | cursor, |
| 1098 | id, |
| 1099 | GRN_CURSOR_BY_IDcxx . . $ `include/groonga/table.h:280:9`!) |
| 1100 | { |
| 1101 | grn_index_column_diff_progresscxx . . $ grn_index_column_diff_progress(dae4f000c2b0d415).(ctx, data); |
| 1102 | for (size_t i = 0; i < n_source_columns; i++) { |
| 1103 | grn_objcxx . . $ grn_obj# *source = GRN_PTR_VALUE_ATcxx . . $ `include/groonga/groonga.h:3150:9`!(source_columns, i); |
| 1104 | const boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! is_reference = grn_obj_is_reference_columncxx . . $ grn_obj_is_reference_column(a5760e5c319a06ee).(ctx, source); |
| 1105 | |
| 1106 | data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..postingcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#posting..ridcxx . . $ $anonymous_type_abfcd92361d8c963_0#rid. = id; |
| 1107 | data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..postingcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#posting..sidcxx . . $ $anonymous_type_abfcd92361d8c963_0#sid. = (uint32_tcxx . . $ uint32_t#)(i + 1); |
| 1108 | /* This is faster than grn_hash_truncate() or grn_hash_create(). */ |
| 1109 | GRN_HASH_EACH_BEGINcxx . . $ `include/groonga/hash.h:141:9`!(ctx, data->current.token_counters, cursor, id) |
| 1110 | { |
| 1111 | grn_hash_cursor_deletecxx . . $ grn_hash_cursor_delete(bed683ba308f8305).(ctx, cursor, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 1112 | } |
| 1113 | GRN_HASH_EACH_ENDcxx . . $ `include/groonga/hash.h:159:9`!(ctx, cursor); |
| 1114 | |
| 1115 | grn_objcxx . . $ grn_obj# *value = &(data->bufferscxx . . $ $anonymous_type_512bede1a7d79c66_2#buffers..valuecxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_5#value.); |
| 1116 | GRN_BULK_REWINDcxx . . $ `include/groonga/groonga.h:2599:9`!(value); |
| 1117 | grn_obj_get_valuecxx . . $ grn_obj_get_value(6e06fec66698a6a).(ctx, source, id, value); |
| 1118 | if (ctx->rccxx . . $ _grn_ctx#rc. != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 1119 | break; |
| 1120 | } |
| 1121 | grn_objcxx . . $ grn_obj# *extracted_value = grn_table_extractcxx . . $ grn_table_extract(88456f97fe0d41a).(ctx, data->lexiconcxx . . $ $anonymous_type_512bede1a7d79c66_2#lexicon., value); |
| 1122 | if (ctx->rccxx . . $ _grn_ctx#rc. != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 1123 | break; |
| 1124 | } |
| 1125 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! extracted = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!; |
| 1126 | if (extracted_value != value) { |
| 1127 | extracted = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!; |
| 1128 | value = extracted_value; |
| 1129 | } |
| 1130 | |
| 1131 | switch (value->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type.) { |
| 1132 | case GRN_VECTORcxx . . $ `include/groonga/groonga.h:877:9`!: |
| 1133 | { |
| 1134 | const size_t n_elements = grn_vector_sizecxx . . $ grn_vector_size(8dd58acc9865e889).(ctx, value); |
| 1135 | for (size_t j = 0; j < n_elements; j++) { |
| 1136 | const char *element = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 1137 | grn_idcxx . . $ grn_id# domain = GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!; |
| 1138 | const unsigned int element_size = |
| 1139 | grn_vector_get_elementcxx . . $ grn_vector_get_element(744613554bd9830c).(ctx, |
| 1140 | value, |
| 1141 | (uint32_tcxx . . $ uint32_t#)j, |
| 1142 | &element, |
| 1143 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, |
| 1144 | &domain); |
| 1145 | data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..postingcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#posting..sidcxx . . $ $anonymous_type_abfcd92361d8c963_0#sid. = (uint32_tcxx . . $ uint32_t#)(j + 1); |
| 1146 | if (!data->have_tokenizercxx . . $ $anonymous_type_512bede1a7d79c66_2#have_tokenizer.) { |
| 1147 | data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..postingcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#posting..poscxx . . $ $anonymous_type_abfcd92361d8c963_0#pos. = j; |
| 1148 | } |
| 1149 | grn_index_column_diff_process_tokencxx . . $ grn_index_column_diff_process_token(37d1ab8cb06460b9).(ctx, |
| 1150 | data, |
| 1151 | element, |
| 1152 | element_size, |
| 1153 | domain); |
| 1154 | if (ctx->rccxx . . $ _grn_ctx#rc. != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 1155 | if (extracted) { |
| 1156 | grn_obj_closecxx . . $ grn_obj_close(4865d068a46d0f83).(ctx, extracted_value); |
| 1157 | } |
| 1158 | break; |
| 1159 | } |
| 1160 | } |
| 1161 | } |
| 1162 | break; |
| 1163 | case GRN_UVECTORcxx . . $ `include/groonga/groonga.h:875:9`!: |
| 1164 | if (is_reference) { |
| 1165 | const size_t n_elements = grn_uvector_sizecxx . . $ grn_uvector_size(8dd58acc9865e889).(ctx, value); |
| 1166 | for (size_t j = 0; j < n_elements; j++) { |
| 1167 | const grn_idcxx . . $ grn_id# element = |
| 1168 | grn_uvector_get_elementcxx . . $ grn_uvector_get_element(621459fee6c81b73).(ctx, value, (uint32_tcxx . . $ uint32_t#)j, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 1169 | if (element == GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) { |
| 1170 | continue; |
| 1171 | } |
| 1172 | data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..token_idcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#token_id. = element; |
| 1173 | if (data->have_tokenizercxx . . $ $anonymous_type_512bede1a7d79c66_2#have_tokenizer.) { |
| 1174 | data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..postingcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#posting..poscxx . . $ $anonymous_type_abfcd92361d8c963_0#pos. = 0; |
| 1175 | } else { |
| 1176 | data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..postingcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#posting..poscxx . . $ $anonymous_type_abfcd92361d8c963_0#pos. = j; |
| 1177 | } |
| 1178 | grn_index_column_diff_process_token_idcxx . . $ grn_index_column_diff_process_token_id(dae4f000c2b0d415).(ctx, data); |
| 1179 | if (ctx->rccxx . . $ _grn_ctx#rc. != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 1180 | break; |
| 1181 | } |
| 1182 | } |
| 1183 | } else { |
| 1184 | const size_t n_elements = grn_uvector_sizecxx . . $ grn_uvector_size(8dd58acc9865e889).(ctx, value); |
| 1185 | const size_t element_size = grn_uvector_element_sizecxx . . $ grn_uvector_element_size(8dd58acc9865e889).(ctx, value); |
| 1186 | for (size_t j = 0; j < n_elements; j++) { |
| 1187 | const char *element = GRN_BULK_HEADcxx . . $ `include/groonga/groonga.h:2648:9`!(value) + (element_size * j); |
| 1188 | data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..token_idcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#token_id. = |
| 1189 | grn_table_getcxx . . $ grn_table_get(5676c91e20172100).(ctx, |
| 1190 | data->lexiconcxx . . $ $anonymous_type_512bede1a7d79c66_2#lexicon., |
| 1191 | element, |
| 1192 | (const unsigned int)element_size); |
| 1193 | if (data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..token_idcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#token_id. == GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) { |
| 1194 | continue; |
| 1195 | } |
| 1196 | if (data->have_tokenizercxx . . $ $anonymous_type_512bede1a7d79c66_2#have_tokenizer.) { |
| 1197 | data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..postingcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#posting..poscxx . . $ $anonymous_type_abfcd92361d8c963_0#pos. = 0; |
| 1198 | } else { |
| 1199 | data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..postingcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#posting..poscxx . . $ $anonymous_type_abfcd92361d8c963_0#pos. = j; |
| 1200 | } |
| 1201 | grn_index_column_diff_process_token_idcxx . . $ grn_index_column_diff_process_token_id(dae4f000c2b0d415).(ctx, data); |
| 1202 | if (ctx->rccxx . . $ _grn_ctx#rc. != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 1203 | break; |
| 1204 | } |
| 1205 | } |
| 1206 | } |
| 1207 | break; |
| 1208 | case GRN_BULKcxx . . $ `include/groonga/groonga.h:868:9`!: |
| 1209 | if (GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(value) > 0) { |
| 1210 | if (is_reference) { |
| 1211 | data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..token_idcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#token_id. = GRN_RECORD_VALUEcxx . . $ `include/groonga/groonga.h:3110:9`!(value); |
| 1212 | if (data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..token_idcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#token_id. != GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) { |
| 1213 | data->currentcxx . . $ $anonymous_type_512bede1a7d79c66_2#current..postingcxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_4#posting..poscxx . . $ $anonymous_type_abfcd92361d8c963_0#pos. = 0; |
| 1214 | grn_index_column_diff_process_token_idcxx . . $ grn_index_column_diff_process_token_id(dae4f000c2b0d415).(ctx, data); |
| 1215 | } |
| 1216 | } else { |
| 1217 | grn_index_column_diff_process_tokencxx . . $ grn_index_column_diff_process_token(37d1ab8cb06460b9).(ctx, |
| 1218 | data, |
| 1219 | GRN_BULK_HEADcxx . . $ `include/groonga/groonga.h:2648:9`!(value), |
| 1220 | GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(value), |
| 1221 | value->headercxx . . $ _grn_obj#header..domaincxx . . $ _grn_obj_header#domain.); |
| 1222 | } |
| 1223 | } |
| 1224 | break; |
| 1225 | default: |
| 1226 | break; |
| 1227 | } |
| 1228 | |
| 1229 | if (extracted) { |
| 1230 | grn_obj_closecxx . . $ grn_obj_close(4865d068a46d0f83).(ctx, extracted_value); |
| 1231 | } |
| 1232 | |
| 1233 | if (ctx->rccxx . . $ _grn_ctx#rc. != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 1234 | break; |
| 1235 | } |
| 1236 | } |
| 1237 | if (ctx->rccxx . . $ _grn_ctx#rc. != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 1238 | break; |
| 1239 | } |
| 1240 | } |
| 1241 | GRN_TABLE_EACH_ENDcxx . . $ `include/groonga/table.h:665:9`!(ctx, cursor); |
| 1242 | |
| 1243 | GRN_HASH_EACH_BEGINcxx . . $ `include/groonga/hash.h:141:9`!(ctx, data->posting_lists, cursor, id) |
| 1244 | { |
| 1245 | void *value; |
| 1246 | grn_hash_cursor_get_valuecxx . . $ grn_hash_cursor_get_value(248c0d78df691c42).(ctx, cursor, &value); |
| 1247 | grn_index_column_diff_posting_listcxx . . $ grn_index_column_diff_posting_list# *posting_list = value; |
| 1248 | grn_index_column_diff_posting_list_fincxx . . $ grn_index_column_diff_posting_list_fin(5963bf8650f65308).(ctx, data, posting_list); |
| 1249 | } |
| 1250 | GRN_HASH_EACH_ENDcxx . . $ `include/groonga/hash.h:159:9`!(ctx, cursor); |
| 1251 | grn_hash_closecxx . . $ grn_hash_close(c005d027d163fb0b).(ctx, data->posting_listscxx . . $ $anonymous_type_512bede1a7d79c66_2#posting_lists.); |
| 1252 | } |
| 1253 | |
| 1254 | grn_rccxx . . $ grn_rc# |
| 1255 | grn_index_column_diff_fullcxx . . $ grn_index_column_diff_full(538810a42b48bfbe).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 1256 | grn_objcxx . . $ grn_obj# *index_column, |
| 1257 | grn_index_column_diff_optionscxx . . $ grn_index_column_diff_options# *options, |
| 1258 | grn_objcxx . . $ grn_obj# **diff) |
| 1259 | { |
| 1260 | grn_index_column_diff_datacxx . . $ grn_index_column_diff_data# data = {0}; |
| 1261 | |
| 1262 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 1263 | |
| 1264 | grn_index_column_diff_data_initcxx . . $ grn_index_column_diff_data_init(addfcda60cf01579).(ctx, &data, options); |
| 1265 | if (ctx->rccxx . . $ _grn_ctx#rc. != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 1266 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 1267 | } |
| 1268 | |
| 1269 | if (!index_column) { |
| 1270 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, |
| 1271 | "[index-column][diff] index column must not NULL"); |
| 1272 | goto exit; |
| 1273 | } |
| 1274 | if (!grn_obj_is_index_columncxx . . $ grn_obj_is_index_column(a5760e5c319a06ee).(ctx, index_column)) { |
| 1275 | char name[GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!]; |
| 1276 | int name_size; |
| 1277 | name_size = grn_obj_namecxx . . $ grn_obj_name(a51d1bff955f2f21).(ctx, index_column, name, sizeof(name)); |
| 1278 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, |
| 1279 | "[index-column][diff] invalid index column: <%.*s>: <%s>", |
| 1280 | name_size, |
| 1281 | name, |
| 1282 | grn_obj_type_to_string(index_column->header.type)); |
| 1283 | goto exit; |
| 1284 | } |
| 1285 | data.iicxx . . $ $anonymous_type_512bede1a7d79c66_2#ii. = (grn_iicxx . . $ grn_ii# *)index_column; |
| 1286 | { |
| 1287 | data.indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..name_sizecxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#name_size. = |
| 1288 | grn_obj_namecxx . . $ grn_obj_name(a51d1bff955f2f21).(ctx, index_column, data.indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..namecxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#name., sizeof(data.indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..namecxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#name.)); |
| 1289 | grn_column_flagscxx . . $ grn_column_flags# flags = grn_column_get_flagscxx . . $ grn_column_get_flags(8dd58acc9865e889).(ctx, index_column); |
| 1290 | data.indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..with_sectioncxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#with_section. = |
| 1291 | ((flags & GRN_OBJ_WITH_SECTIONcxx . . $ `include/groonga/groonga.h:777:9`!) == GRN_OBJ_WITH_SECTIONcxx . . $ `include/groonga/groonga.h:777:9`!); |
| 1292 | data.indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..with_positioncxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#with_position. = |
| 1293 | ((flags & GRN_OBJ_WITH_POSITIONcxx . . $ `include/groonga/groonga.h:794:9`!) == GRN_OBJ_WITH_POSITIONcxx . . $ `include/groonga/groonga.h:794:9`!); |
| 1294 | data.indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..n_elementscxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#n_elements. = grn_ii_get_n_elementscxx . . $ grn_ii_get_n_elements(2156535cb565d339).(ctx, data.iicxx . . $ $anonymous_type_512bede1a7d79c66_2#ii.); |
| 1295 | } |
| 1296 | |
| 1297 | data.n_posting_elementscxx . . $ $anonymous_type_512bede1a7d79c66_2#n_posting_elements. = 1; |
| 1298 | if (data.indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..with_sectioncxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#with_section.) { |
| 1299 | data.n_posting_elementscxx . . $ $anonymous_type_512bede1a7d79c66_2#n_posting_elements.++; |
| 1300 | } |
| 1301 | if (data.indexcxx . . $ $anonymous_type_512bede1a7d79c66_2#index..with_positioncxx . . $ $anonymous_type_512bede1a7d79c66_2#$anonymous_type_3#with_position.) { |
| 1302 | data.n_posting_elementscxx . . $ $anonymous_type_512bede1a7d79c66_2#n_posting_elements.++; |
| 1303 | } |
| 1304 | |
| 1305 | data.source_tablecxx . . $ $anonymous_type_512bede1a7d79c66_2#source_table. = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, grn_obj_get_rangecxx . . $ grn_obj_get_range(8dd58acc9865e889).(ctx, index_column)); |
| 1306 | { |
| 1307 | grn_objcxx . . $ grn_obj# source_columns; |
| 1308 | GRN_RECORD_INITcxx . . $ `include/groonga/groonga.h:2868:9`!(&source_columns, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!, GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!); |
| 1309 | grn_obj_get_infocxx . . $ grn_obj_get_info(333a81d4a8f20670).(ctx, index_column, GRN_INFO_SOURCEcxx . . $ GRN_INFO_SOURCE., &source_columns); |
| 1310 | size_t n_columns = GRN_RECORD_VECTOR_SIZEcxx . . $ `include/groonga/groonga.h:3264:9`!(&source_columns); |
| 1311 | for (size_t i = 0; i < n_columns; i++) { |
| 1312 | grn_idcxx . . $ grn_id# source_id = GRN_RECORD_VALUE_ATcxx . . $ `include/groonga/groonga.h:3148:9`!(&source_columns, i); |
| 1313 | grn_objcxx . . $ grn_obj# *source = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, source_id); |
| 1314 | if (grn_obj_is_tablecxx . . $ grn_obj_is_table(a5760e5c319a06ee).(ctx, source)) { |
| 1315 | source = grn_obj_columncxx . . $ grn_obj_column(c00e49795c44129a).(ctx, |
| 1316 | source, |
| 1317 | GRN_COLUMN_NAME_KEYcxx . . $ `include/groonga/column.h:63:9`!, |
| 1318 | GRN_COLUMN_NAME_KEY_LENcxx . . $ `include/groonga/column.h:72:9`!); |
| 1319 | } |
| 1320 | GRN_PTR_PUTcxx . . $ `include/groonga/groonga.h:3218:9`!(ctx, &(data.source_columns), source); |
| 1321 | } |
| 1322 | GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &source_columns); |
| 1323 | } |
| 1324 | |
| 1325 | data.lexiconcxx . . $ $anonymous_type_512bede1a7d79c66_2#lexicon. = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, index_column->headercxx . . $ _grn_obj#header..domaincxx . . $ _grn_obj_header#domain.); |
| 1326 | if (ctx->rccxx . . $ _grn_ctx#rc. != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 1327 | goto exit; |
| 1328 | } |
| 1329 | data.have_tokenizercxx . . $ $anonymous_type_512bede1a7d79c66_2#have_tokenizer. = grn_table_have_tokenizercxx . . $ grn_table_have_tokenizer(a5760e5c319a06ee).(ctx, data.lexiconcxx . . $ $anonymous_type_512bede1a7d79c66_2#lexicon.); |
| 1330 | |
| 1331 | data.diffcxx . . $ $anonymous_type_512bede1a7d79c66_2#diff. = grn_table_createcxx . . $ grn_table_create(51df5019e8d3bdc1).(ctx, |
| 1332 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, |
| 1333 | 0, |
| 1334 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, |
| 1335 | GRN_TABLE_HASH_KEYcxx . . $ `include/groonga/groonga.h:895:9`!, |
| 1336 | data.lexiconcxx . . $ $anonymous_type_512bede1a7d79c66_2#lexicon., |
| 1337 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 1338 | if (!data.diffcxx . . $ $anonymous_type_512bede1a7d79c66_2#diff.) { |
| 1339 | char message[GRN_CTX_MSGSIZEcxx . . $ `include/groonga/groonga.h:334:9`!]; |
| 1340 | grn_strcpycxx . . $ `include/groonga/portability.h:101:11`!(message, GRN_CTX_MSGSIZE, ctx->errbuf); |
| 1341 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, |
| 1342 | "[index-column][diff] failed to create diff table: <%.*s>: %s", |
| 1343 | data.index.name_size, |
| 1344 | data.index.name, |
| 1345 | message); |
| 1346 | goto exit; |
| 1347 | } |
| 1348 | data.posting_listscxx . . $ $anonymous_type_512bede1a7d79c66_2#posting_lists. = |
| 1349 | grn_hash_createcxx . . $ grn_hash_create(db1bba7e0d64660).(ctx, |
| 1350 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, |
| 1351 | sizeof(grn_idcxx . . $ grn_id#), |
| 1352 | sizeof(grn_index_column_diff_posting_listcxx . . $ grn_index_column_diff_posting_list#), |
| 1353 | GRN_OBJ_TABLE_HASH_KEYcxx . . $ `include/groonga/groonga.h:688:9`!); |
| 1354 | if (!data.posting_listscxx . . $ $anonymous_type_512bede1a7d79c66_2#posting_lists.) { |
| 1355 | char message[GRN_CTX_MSGSIZEcxx . . $ `include/groonga/groonga.h:334:9`!]; |
| 1356 | grn_strcpycxx . . $ `include/groonga/portability.h:101:11`!(message, GRN_CTX_MSGSIZE, ctx->errbuf); |
| 1357 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, |
| 1358 | "[index-column][diff] failed to create hash table for posting lists: " |
| 1359 | "<%.*s>: %s", |
| 1360 | data.index.name_size, |
| 1361 | data.index.name, |
| 1362 | message); |
| 1363 | goto exit; |
| 1364 | } |
| 1365 | DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(data.posting_lists)->headercxx . . $ $anonymous_type_4a7c1014017e4c5d_0#header..domaincxx . . $ _grn_obj_header#domain. = grn_obj_idcxx . . $ grn_obj_id(8dd58acc9865e889).(ctx, data.diffcxx . . $ $anonymous_type_512bede1a7d79c66_2#diff.); |
| 1366 | data.remainscxx . . $ $anonymous_type_512bede1a7d79c66_2#remains. = grn_column_createcxx . . $ grn_column_create(dd4a346d390d76df).(ctx, |
| 1367 | data.diffcxx . . $ $anonymous_type_512bede1a7d79c66_2#diff., |
| 1368 | remains_column_namecxx . . $ remains_column_name., |
| 1369 | (unsigned int)strlencxx . . $ strlen(751346f8406fd082).(remains_column_namecxx . . $ remains_column_name.), |
| 1370 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, |
| 1371 | GRN_OBJ_COLUMN_VECTORcxx . . $ `include/groonga/groonga.h:736:9`!, |
| 1372 | grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, GRN_DB_UINT32cxx . . $ GRN_DB_UINT32.)); |
| 1373 | if (!data.remainscxx . . $ $anonymous_type_512bede1a7d79c66_2#remains.) { |
| 1374 | char message[GRN_CTX_MSGSIZEcxx . . $ `include/groonga/groonga.h:334:9`!]; |
| 1375 | grn_strcpycxx . . $ `include/groonga/portability.h:101:11`!(message, GRN_CTX_MSGSIZE, ctx->errbuf); |
| 1376 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, |
| 1377 | "[index-column][diff] failed to create remains column: <%.*s>: %s", |
| 1378 | data.index.name_size, |
| 1379 | data.index.name, |
| 1380 | message); |
| 1381 | goto exit; |
| 1382 | } |
| 1383 | data.missingscxx . . $ $anonymous_type_512bede1a7d79c66_2#missings. = grn_column_createcxx . . $ grn_column_create(dd4a346d390d76df).(ctx, |
| 1384 | data.diffcxx . . $ $anonymous_type_512bede1a7d79c66_2#diff., |
| 1385 | missings_column_namecxx . . $ missings_column_name., |
| 1386 | (unsigned int)strlencxx . . $ strlen(751346f8406fd082).(missings_column_namecxx . . $ missings_column_name.), |
| 1387 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, |
| 1388 | GRN_OBJ_COLUMN_VECTORcxx . . $ `include/groonga/groonga.h:736:9`!, |
| 1389 | grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, GRN_DB_UINT32cxx . . $ GRN_DB_UINT32.)); |
| 1390 | if (!data.missingscxx . . $ $anonymous_type_512bede1a7d79c66_2#missings.) { |
| 1391 | char message[GRN_CTX_MSGSIZEcxx . . $ `include/groonga/groonga.h:334:9`!]; |
| 1392 | grn_strcpycxx . . $ `include/groonga/portability.h:101:11`!(message, GRN_CTX_MSGSIZE, ctx->errbuf); |
| 1393 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, |
| 1394 | "[index-column][diff] failed to create missings column: <%.*s>: %s", |
| 1395 | data.index.name_size, |
| 1396 | data.index.name, |
| 1397 | message); |
| 1398 | goto exit; |
| 1399 | } |
| 1400 | |
| 1401 | grn_index_column_diff_computecxx . . $ grn_index_column_diff_compute(dae4f000c2b0d415).(ctx, &data); |
| 1402 | *diff = data.diffcxx . . $ $anonymous_type_512bede1a7d79c66_2#diff.; |
| 1403 | data.diffcxx . . $ $anonymous_type_512bede1a7d79c66_2#diff. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 1404 | |
| 1405 | exit: |
| 1406 | if (data.diffcxx . . $ $anonymous_type_512bede1a7d79c66_2#diff.) { |
| 1407 | grn_obj_closecxx . . $ grn_obj_close(4865d068a46d0f83).(ctx, data.diffcxx . . $ $anonymous_type_512bede1a7d79c66_2#diff.); |
| 1408 | } |
| 1409 | |
| 1410 | grn_index_column_diff_data_fincxx . . $ grn_index_column_diff_data_fin(dae4f000c2b0d415).(ctx, &data); |
| 1411 | |
| 1412 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 1413 | } |
| 1414 | |
| 1415 | grn_rccxx . . $ grn_rc# |
| 1416 | grn_index_column_diffcxx . . $ grn_index_column_diff(efa9ae2101fcb92b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *index_column, grn_objcxx . . $ grn_obj# **diff) |
| 1417 | { |
| 1418 | return grn_index_column_diff_fullcxx . . $ grn_index_column_diff_full(538810a42b48bfbe).(ctx, index_column, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, diff); |
| 1419 | } |
| 1420 | |
| 1421 | grn_objcxx . . $ grn_obj# * |
| 1422 | grn_index_column_get_tokenizercxx . . $ grn_index_column_get_tokenizer(e9f40e4080908c1e).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *index_column) |
| 1423 | { |
| 1424 | grn_objcxx . . $ grn_obj# *tokenizer; |
| 1425 | grn_objcxx . . $ grn_obj# *lexicon; |
| 1426 | |
| 1427 | lexicon = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, index_column->headercxx . . $ _grn_obj#header..domaincxx . . $ _grn_obj_header#domain.); |
| 1428 | if (!lexicon) { |
| 1429 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 1430 | } |
| 1431 | |
| 1432 | grn_table_get_infocxx . . $ grn_table_get_info(a1e4a6d36d3aee7c).(ctx, lexicon, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, &tokenizer, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 1433 | grn_obj_unrefcxx . . $ grn_obj_unref(cda3a5f3c2e53c6b).(ctx, lexicon); |
| 1434 | |
| 1435 | return tokenizer; |
| 1436 | } |
| 1437 | |
| 1438 | static boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! |
| 1439 | grn_index_column_is_usable_equalcxx . . $ grn_index_column_is_usable_equal(fd0e963dece92792).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 1440 | grn_objcxx . . $ grn_obj# *index_column, |
| 1441 | grn_operatorcxx . . $ grn_operator# op) |
| 1442 | { |
| 1443 | grn_objcxx . . $ grn_obj# *tokenizer; |
| 1444 | tokenizer = grn_index_column_get_tokenizercxx . . $ grn_index_column_get_tokenizer(e9f40e4080908c1e).(ctx, index_column); |
| 1445 | if (!tokenizer) { |
| 1446 | return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!; |
| 1447 | } |
| 1448 | /* TODO: Improve this. Which tokenizer can be used with equal operation? |
| 1449 | Do we need metadata in tokenizer? */ |
| 1450 | if (DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(tokenizer)->idcxx . . $ $anonymous_type_4a7c1014017e4c5d_0#id. == GRN_DB_DELIMITcxx . . $ GRN_DB_DELIMIT.) { |
| 1451 | return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!; |
| 1452 | } |
| 1453 | return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!; |
| 1454 | } |
| 1455 | |
| 1456 | static boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! |
| 1457 | grn_index_column_is_usable_matchcxx . . $ grn_index_column_is_usable_match(fd0e963dece92792).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 1458 | grn_objcxx . . $ grn_obj# *index_column, |
| 1459 | grn_operatorcxx . . $ grn_operator# op) |
| 1460 | { |
| 1461 | return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!; |
| 1462 | } |
| 1463 | |
| 1464 | static boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! |
| 1465 | grn_index_column_is_usable_rangecxx . . $ grn_index_column_is_usable_range(fd0e963dece92792).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 1466 | grn_objcxx . . $ grn_obj# *index_column, |
| 1467 | grn_operatorcxx . . $ grn_operator# op) |
| 1468 | { |
| 1469 | grn_objcxx . . $ grn_obj# *tokenizer; |
| 1470 | grn_objcxx . . $ grn_obj# *lexicon; |
| 1471 | |
| 1472 | lexicon = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, index_column->headercxx . . $ _grn_obj#header..domaincxx . . $ _grn_obj_header#domain.); |
| 1473 | if (!lexicon) { |
| 1474 | return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!; |
| 1475 | } |
| 1476 | |
| 1477 | switch (lexicon->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type.) { |
| 1478 | case GRN_TABLE_PAT_KEYcxx . . $ `include/groonga/groonga.h:896:9`!: |
| 1479 | case GRN_TABLE_DAT_KEYcxx . . $ `include/groonga/groonga.h:897:9`!: |
| 1480 | break; |
| 1481 | default: |
| 1482 | grn_obj_unrefcxx . . $ grn_obj_unref(cda3a5f3c2e53c6b).(ctx, lexicon); |
| 1483 | return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!; |
| 1484 | } |
| 1485 | |
| 1486 | grn_table_get_infocxx . . $ grn_table_get_info(a1e4a6d36d3aee7c).(ctx, lexicon, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, &tokenizer, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 1487 | grn_obj_unrefcxx . . $ grn_obj_unref(cda3a5f3c2e53c6b).(ctx, lexicon); |
| 1488 | return tokenizer == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 1489 | } |
| 1490 | |
| 1491 | static boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! |
| 1492 | grn_index_column_is_usable_regexpcxx . . $ grn_index_column_is_usable_regexp(fd0e963dece92792).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 1493 | grn_objcxx . . $ grn_obj# *index_column, |
| 1494 | grn_operatorcxx . . $ grn_operator# op) |
| 1495 | { |
| 1496 | grn_objcxx . . $ grn_obj# *tokenizer; |
| 1497 | tokenizer = grn_index_column_get_tokenizercxx . . $ grn_index_column_get_tokenizer(e9f40e4080908c1e).(ctx, index_column); |
| 1498 | if (!tokenizer) { |
| 1499 | return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!; |
| 1500 | } |
| 1501 | return tokenizer == grn_ctx_getcxx . . $ grn_ctx_get(70fde0087014f9ea).(ctx, "TokenRegexp", -1); |
| 1502 | } |
| 1503 | |
| 1504 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! |
| 1505 | grn_index_column_is_usablecxx . . $ grn_index_column_is_usable(fd0e963dece92792).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *index_column, grn_operatorcxx . . $ grn_operator# op) |
| 1506 | { |
| 1507 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 1508 | |
| 1509 | if (!grn_obj_is_index_columncxx . . $ grn_obj_is_index_column(a5760e5c319a06ee).(ctx, index_column)) { |
| 1510 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!); |
| 1511 | } |
| 1512 | |
| 1513 | if (!grn_obj_is_visiblecxx . . $ grn_obj_is_visible(a5760e5c319a06ee).(ctx, index_column)) { |
| 1514 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!); |
| 1515 | } |
| 1516 | |
| 1517 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! usable = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!; |
| 1518 | switch (op) { |
| 1519 | case GRN_OP_EQUALcxx . . $ GRN_OP_EQUAL.: |
| 1520 | case GRN_OP_NOT_EQUALcxx . . $ GRN_OP_NOT_EQUAL.: |
| 1521 | usable = grn_index_column_is_usable_equalcxx . . $ grn_index_column_is_usable_equal(fd0e963dece92792).(ctx, index_column, op); |
| 1522 | break; |
| 1523 | case GRN_OP_MATCHcxx . . $ GRN_OP_MATCH.: |
| 1524 | case GRN_OP_NEARcxx . . $ GRN_OP_NEAR.: |
| 1525 | case GRN_OP_NEAR_NO_OFFSETcxx . . $ GRN_OP_NEAR_NO_OFFSET.: |
| 1526 | case GRN_OP_NEAR_PHRASEcxx . . $ GRN_OP_NEAR_PHRASE.: |
| 1527 | case GRN_OP_ORDERED_NEAR_PHRASEcxx . . $ GRN_OP_ORDERED_NEAR_PHRASE.: |
| 1528 | case GRN_OP_NEAR_PHRASE_PRODUCTcxx . . $ GRN_OP_NEAR_PHRASE_PRODUCT.: |
| 1529 | case GRN_OP_ORDERED_NEAR_PHRASE_PRODUCTcxx . . $ GRN_OP_ORDERED_NEAR_PHRASE_PRODUCT.: |
| 1530 | case GRN_OP_SIMILARcxx . . $ GRN_OP_SIMILAR.: |
| 1531 | case GRN_OP_PREFIXcxx . . $ GRN_OP_PREFIX.: |
| 1532 | case GRN_OP_SUFFIXcxx . . $ GRN_OP_SUFFIX.: |
| 1533 | case GRN_OP_FUZZYcxx . . $ GRN_OP_FUZZY.: |
| 1534 | case GRN_OP_QUORUMcxx . . $ GRN_OP_QUORUM.: |
| 1535 | usable = grn_index_column_is_usable_matchcxx . . $ grn_index_column_is_usable_match(fd0e963dece92792).(ctx, index_column, op); |
| 1536 | break; |
| 1537 | case GRN_OP_LESScxx . . $ GRN_OP_LESS.: |
| 1538 | case GRN_OP_GREATERcxx . . $ GRN_OP_GREATER.: |
| 1539 | case GRN_OP_LESS_EQUALcxx . . $ GRN_OP_LESS_EQUAL.: |
| 1540 | case GRN_OP_GREATER_EQUALcxx . . $ GRN_OP_GREATER_EQUAL.: |
| 1541 | case GRN_OP_CALLcxx . . $ GRN_OP_CALL.: |
| 1542 | usable = grn_index_column_is_usable_rangecxx . . $ grn_index_column_is_usable_range(fd0e963dece92792).(ctx, index_column, op); |
| 1543 | break; |
| 1544 | case GRN_OP_REGEXPcxx . . $ GRN_OP_REGEXP.: |
| 1545 | usable = grn_index_column_is_usable_regexpcxx . . $ grn_index_column_is_usable_regexp(fd0e963dece92792).(ctx, index_column, op); |
| 1546 | break; |
| 1547 | default: |
| 1548 | break; |
| 1549 | } |
| 1550 | |
| 1551 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(usable); |
| 1552 | } |