diff --git a/src/lua/init.cc b/src/lua/init.cc index 9045960ba50d87f999c8b890d473264ce52fe80f..4a091954df062a573d3693ca2aa4e10ad7a67906 100644 --- a/src/lua/init.cc +++ b/src/lua/init.cc @@ -663,20 +663,6 @@ tarantool_lua(struct lua_State *L, lua_settop(L, 0); return; } - /* convert all tuples to tables */ - for (int i = 1; i <= top; i++) { - if (lua_getmetatable(L, i) == 0) - continue; - luaL_getmetatable(L, "box.tuple"); - int is_tuple = 0; - if (lua_equal(L, -1, -2)) - is_tuple = 1; - lua_pop(L, 2); - if (is_tuple) { - luaL_callmeta(L, i, "totable"); - lua_replace(L, i); - } - } yamlL_encode(L); lua_replace(L, 1); lua_pop(L, 1); diff --git a/third_party/lua-yaml/lyaml.c b/third_party/lua-yaml/lyaml.c index 9c2a67dc59de234fc292f889f372546708d86946..3614c5d2ff2074b980a37f6e6697b8c8fe9d24ee 100644 --- a/third_party/lua-yaml/lyaml.c +++ b/third_party/lua-yaml/lyaml.c @@ -436,15 +436,18 @@ static int dump_scalar(struct lua_yaml_dumper *dumper) { len -= 2; break; } - } else if (type == LUA_TUSERDATA || type == LUA_TFUNCTION) { + } else if (type == LUA_TUSERDATA) { + str = dump_tostring(dumper->L, -1); + len = strlen(str); + style = YAML_DOUBLE_QUOTED_SCALAR_STYLE; + } else if (type == LUA_TFUNCTION) { str = dump_tostring(dumper->L, -1); len = strlen(str); } - - yaml_scalar_event_initialize( - &ev, NULL, tag, (unsigned char *)str, len, + yaml_scalar_event_initialize(&ev, NULL, tag, (unsigned char *)str, len, !is_binary, !is_binary, style); - if (is_binary) lua_pop(dumper->L, 1); + if (is_binary) + lua_pop(dumper->L, 1); return yaml_emitter_emit(&dumper->emitter, &ev); }