Skip to content

Commit

Permalink
In .u.add, if v had some rows, 0#t dropped the g attr, so the subscri…
Browse files Browse the repository at this point in the history
…ber could be missing the g attr on a table, impacting queries.

Now .u.add ensures sym has g attr in schema returned to new subscriber.
  • Loading branch information
CharlieSkelton-Kx committed Jun 17, 2019
1 parent 0ef58b6 commit afc67ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tick/u.q
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/2019.06.17 ensure sym has g attr for schema returned to new subscriber
/2008.09.09 .k -> .q
/2006.05.08 add

Expand All @@ -10,7 +11,7 @@ sel:{$[`~y;x;select from x where sym in y]}

pub:{[t;x]{[t;x;w]if[count x:sel[x]w 1;(neg first w)(`upd;t;x)]}[t;x]each w t}

add:{$[(count w x)>i:w[x;;0]?.z.w;.[`.u.w;(x;i;1);union;y];w[x],:enlist(.z.w;y)];(x;$[99=type v:value x;sel[v]y;0#v])}
add:{$[(count w x)>i:w[x;;0]?.z.w;.[`.u.w;(x;i;1);union;y];w[x],:enlist(.z.w;y)];(x;$[99=type v:value x;sel[v]y;@[0#v;`sym;`g#]])}

sub:{if[x~`;:sub[;y]each t];if[not x in t;'x];del[x].z.w;add[x;y]}

Expand Down

0 comments on commit afc67ed

Please sign in to comment.