# HG changeset patch # User jbe # Date 1452357150 -3600 # Node ID 0dff5e2f659cbf776414e5a65362bb93d34b3eca # Parent 015be25c98dd30c14098866c6517b9da326ccaeb Changed mondelefant_result_index C-function: lookup in _data table (regular columns) is done last; lookup in _data table is omitted if "document_column" attribute of class is set diff -r 015be25c98dd -r 0dff5e2f659c libraries/mondelefant/mondelefant_native.c --- a/libraries/mondelefant/mondelefant_native.c Sat Jan 09 05:30:45 2016 +0100 +++ b/libraries/mondelefant/mondelefant_native.c Sat Jan 09 17:32:30 2016 +0100 @@ -1647,11 +1647,6 @@ } lua_settop(L, 3); lua_getfield(L, 1, "_data"); // _data table on stack position 4 - // try normal data field info: - lua_pushvalue(L, 2); // 5 - lua_gettable(L, 4); // 5 - if (!lua_isnil(L, 5)) return 1; - lua_settop(L, 4); // keep _data table on stack // try cached referenced object (or cached NULL reference): lua_getfield(L, 1, "_ref"); // 5 lua_pushvalue(L, 2); // 6 @@ -1682,17 +1677,21 @@ return 1; } lua_settop(L, 4); - // try proxy access to document in special column: + // check if proxy access to document in special column is enabled: lua_getfield(L, 3, "document_column"); // 5 if (lua_toboolean(L, 5)) { + // if yes, then proxy access: lua_gettable(L, 4); // 5 if (!lua_isnil(L, 5)) { lua_pushvalue(L, 2); // 6 lua_gettable(L, 5); // 6 - if (!lua_isnil(L, 6)) return 1; } + } else { + // else use _data table: + lua_pushvalue(L, 2); // 6 + lua_gettable(L, 4); // 6 } - return 0; + return 1; // return element at stack position 5 or 6 } else if (result_type && !strcmp(result_type, "list")) { // list lua_settop(L, 3); // try inherited list attributes or methods: