Skip to content

Commit

Permalink
fix parsing index definitions for new tarantool
Browse files Browse the repository at this point in the history
  • Loading branch information
funny-falcon committed Oct 31, 2015
1 parent f61adb5 commit 0911a59
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/tarantool16/db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,14 @@ def _fill_spaces(rows)

def _fill_indices(spaces, rows)
rows.
map{|row| [row[0], [row[2], row[1], row[3], 6.step(row.size-1, 2).map{|i| row[i]}]]}.
map{|row|
if row[4].is_a? Hash
# new format
[row[0], [row[2], row[1], row[3], row[5].map(&:first)]]
else
[row[0], [row[2], row[1], row[3], 6.step(row.size-1, 2).map{|i| row[i]}]]
end
}.
group_by{|sid, _| sid}.
each do |sid, inds|
sp = spaces[sid]
Expand Down

0 comments on commit 0911a59

Please sign in to comment.